QueueMetrics forum

QueueMetrics => Improving QueueMetrics => Topic started by: emilec on February 23, 2012, 13:51:26

Title: Add logrotation file for Tomcat to Loway repo
Post by: emilec on February 23, 2012, 13:51:26
If you install Tomcat from the CentOS repo it creates a logrotation file which will ensure that logs are rotated weekly. If you install Tomcat from the Loway repo no logrotation file is created. I would like to propose creating a /etc/logrotate.d/qm-tomcat6 file which is installed from the Loway Repo. The naming convention follows that of the tomcat init script Loway creates.

The default tomcat file looks as follows:
/etc/logrotate.d/tomcat5
Code: [Select]
/var/log/tomcat5/catalina.out {
    copytruncate
    weekly
    rotate 52
    compress
    missingok
}

I think the log rotation should be a bit more aggressive and can deal with *.log:
/etc/logrotate.d/qm-tomcat6
Code: [Select]
/usr/local/queuemetrics/tomcat/logs/*.log {
    notifempty
    copytruncate
    daily
    size=+1024k
    rotate 10
    compress
    missingok
}

/usr/local/queuemetrics/tomcat/logs/catalina.out {
    notifempty
    copytruncate
    dateext
    daily
    size=+1024k
    rotate 10
    compress
    missingok
}

I have gone through the manual steps to set this up in this thread: http://forum.queuemetrics.com/index.php?topic=1441.0
Title: Re: Add logrotation file for Tomcat to Loway repo
Post by: QueueMetrics on February 24, 2012, 10:31:33
Thanks I'll add this for the next release. We will have some changes to infrastructure, most notably an easy way to run AGAW :-)

We track this as bug #1587
Title: Re: Add logrotation file for Tomcat to Loway repo
Post by: emilec on May 31, 2012, 08:57:25
UPDATE: I have subsequently added size=+1024k to my suggestion as this seems to get past the logrotate.conf issues of only rotating logs weekly (first post updated).