아파치 날짜별 로그
1. vi /etc/httpd/conf/httpd-vhosts.conf
2. CustomLog "|/usr/sbin/rotatelogs /data/logs/httpd/access.log.%Y%m%d 86400" common
- /usr/sbin/rotatelogs 경로는 다를수 있음.
3. alias 등록
- vi ~/.bashrc
- alias alog='tail -f /data/logs/httpd/access.log.$(date +%Y%m%d)'
- source ~/.bashrc
톰캣 날짜별 로그
1. vi /톰캣경로/bin/catalina.sh
2. 3군대 수정
shift
#touch "$CATALINA_OUT" <<이부분 주석처리
if [ "$1" = "-security" ] ; then
if [ $have_tty -eq 1 ]; then
echo "Using Security Manager"
fi
shift
eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
-Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
-Djava.security.manager \
-Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \
-Dcatalina.base="\"$CATALINA_BASE\"" \
-Dcatalina.home="\"$CATALINA_HOME\"" \
-Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
org.apache.catalina.startup.Bootstrap "$@" start \
2>&1 "&" | /usr/sbin/rotatelogs "$CATALINA_OUT"-%Y%m%d 86400 540 &
else
eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
-Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
-Dcatalina.base="\"$CATALINA_BASE\"" \
-Dcatalina.home="\"$CATALINA_HOME\"" \
-Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
org.apache.catalina.startup.Bootstrap "$@" start \
2>&1 "&" | /usr/sbin/rotatelogs "$CATALINA_OUT"-%Y%m%d 86400 540 &
3. alias 등록
- vi ~/.bashrc
- alias tlog='tail -f /data/apps/tomcat/logs/catalina.out-$(date +%Y%m%d)'
- source ~/.bashrc
'서버설정 및 설치 > SERVER' 카테고리의 다른 글
Spring Boot - jar로 서비스 등록 (0) | 2020.03.27 |
---|---|
openjdk 설치 (0) | 2020.03.27 |
sendmail 설치 (1) | 2018.07.11 |
젠킨스 설치 및 톰캣 연동 (0) | 2018.07.11 |
gradle 설치 (0) | 2018.07.11 |