Author Topic: Add logrotation file for Tomcat to Loway repo  (Read 3601 times)

emilec

  • Newbie
  • *
  • Posts: 43
  • Karma: 4
    • View Profile
    • Email
Add logrotation file for Tomcat to Loway repo
« 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
« Last Edit: May 31, 2012, 08:56:34 by emilec »

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Add logrotation file for Tomcat to Loway repo
« Reply #1 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

emilec

  • Newbie
  • *
  • Posts: 43
  • Karma: 4
    • View Profile
    • Email
Re: Add logrotation file for Tomcat to Loway repo
« Reply #2 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).