Apache Tomcat & logrotate

Posted on Tue 31 August 2010 in Linux • 1 min read

Some linux distribution are shiped without a config for the catalina.out (Tomcat application server) ;)

$ cat /etc/logrotate.d/tomcat
/var/log/tomcat/base/catalina.out {
    compress
    copytruncate
    create 644 tomcat tomcat
    rotate 30
    size 4M
}

The catalina.out will be rotated after 4 mb and stored for 30 days (/var/log/tomcat/base/catalina.out.1; /var/log/tomcat/base/catalina.out.2.gz and so on)