Project

General

Profile

Task #2434

Ensure log rotation is reasonable for tomcat on MNs

Added by Chris Jones over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Metacat
Start date:
2012-03-02
Due date:
% Done:

100%

Milestone:
CCI-1.0.0
Product Version:
*
Story Points:
Sprint:

Description

Andy noticed:

With all the testing going on against demo3, the tomcat log file has gotten kind of large (~1.4GB). I would suggest throwing a log rotate configuration file into place.

For example, you can put the following in /etc/logrotate.d/tomcat:

/var/log/tomcat6/catalina.out {
missingok
rotate 30
dateext
delaycompress
ifempty
create 644 tomcat6 tomcat6
copytruncate
}

One problem is that tomcat keeps the file handle open. So instead of restarting it, I just do a copy & truncate. There is a chance you'll miss a log entry or two, but I don't think that's too important on a dev box.

A quick description: The above configuration will deal with missing files, delete older than 30 copies, use the date as an extension instead of a number, compress all but the most recent archive, do it even if it's empty, and the new files will be readable by all and owned by tomcat6:tomcat6.


We are rotating files for Metacat using the log4j.properties configuration on the CNs, and should do the same on the MNs.

History

#1 Updated by Chris Jones over 12 years ago

  • Status changed from New to Closed

I've modified the tomcat config in the sandbox MNs to rotate logs.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)