A script to rotate Tomcat's catalina.out

We use 'copytruncate' so we don't need to restart tomcat in a postrotate script. Some logging data may be lost between copying and truncating the logfile but this is a tradeoff against having to restart tomcat.

/etc/logrotate.d/tomcat:

/usr/local/tomcat/logs/catalina.out {
  weekly
  rotate 52
  copytruncate
  notifempty
  missingok
}

This will keep a year's worth of weekly logs.


CategoryLinux

TomcatLogrotate (last edited 2008-02-25 09:58:53 by DavidKeen)