1、下载
wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
2、解压
tar zxvf cronolog-1.6.2.tar.gz
3、运行安装
cd cronolog-1.6.2
./configure
make
make install
4、查看
which cronolog
5、配置
vi apache-tomcat-7.0.77/bin/catalina.sh
398行注释或删除
411-412行和420-421行替换(其中的路径就是第四步操作的结果路径)
398 # touch "$CATALINA_OUT"
399 if [ "$1" = "-security" ] ; then
400 if [ $have_tty -eq 1 ]; then
401 echo "Using Security Manager"
402 fi
403 shift
404 eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
405 -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
406 -Djava.security.manager \
407 -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \
408 -Dcatalina.base="\"$CATALINA_BASE\"" \
409 -Dcatalina.home="\"$CATALINA_HOME\"" \
410 -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
411 org.apache.catalina.startup.Bootstrap "$@" start \
412 2>&1 | /usr/local/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null &
413
414 else
415 eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \
416 -Djava.endorsed.dirs="\"$JAVA_ENDORSED_DIRS\"" -classpath "\"$CLASSPATH\"" \
417 -Dcatalina.base="\"$CATALINA_BASE\"" \
418 -Dcatalina.home="\"$CATALINA_HOME\"" \
419 -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \
420 org.apache.catalina.startup.Bootstrap "$@" start \
421 2>&1 | /usr/local/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null &
422
423 fi
6、查看是否配置成功(重启Tomcat)
日志文件夹下面会出现out结尾的日志文件