Skip to content

Tomcat Logging – logrotate.d for catalina.out

Tomcat Logging – logrotate.d for catalina.out published on

To avoid to have a big catalina.out log file, create a file /etc/logrotate.d/tomcat with this content:

#logrotate for catalina.out
/opt/tomcat/logs/catalina.out {
daily
copytruncate
rotate 4
size 5M
compress
missingok
}

To test logrotate script, use this (without "-d" the rotation run):

/usr/sbin/logrotate -d /etc/logrotate.d/tomcat