标签:
安装cronolog工具,安装位置默认为:/usr/sbin/cronolog
yum install cronolog which cronolog
修改catalina.sh配置,对于tomcat7的文件,在381-382行、390-391行两处
org.apache.catalina.startup.Bootstrap "$@" start >> "$CATALINA_OUT" 2>&1 "&"
改为:
org.apache.catalina.startup.Bootstrap "$@" start 2>&1 |/usr/sbin/cronolog "$CATALINA_BASE"/logs/catalina.out.%Y-%m-%d.out>> /dev/null &
369行可注释掉,如
#touch "$CATALINA_OUT"
操作笔记:catalina.out膨胀太快,分割tomcat 7日志
标签:
原文地址:http://my.oschina.net/u/221951/blog/478330