cronolog分割tomcat的catalina.out文件

vim /usr/local/apache2/conf/httpd.conf 
将默认日志: CustomLog "logs/access_log" combined 
修改为:CustomLog "|/usr/local/sbin/cronolog /log/www/access_%Y%m%d.log" combined 即可。其中%Y%m%d为日志文件分割方式,即为“年月日”。 


  org.apache.catalina.startup.Bootstrap "$@" start  2>&1 \
      | /usr/local/sbin/cronolog "$CATALINA_BASE"/logs/catalina.%Y-%m-%d.out >> /dev/null &



touch “$CATALINA_BASE”/logs/catalina.out

你可能感兴趣的:(cronolog分割tomcat的catalina.out文件)