Zope Zone Navigation
 
Document Actions
  • Print this page
  • Add Bookmarklet

How do you rotate Zope logs with logrotate?

Up to Table of Contents

How do you rotate Zope logs with logrotate?

Logrotate is a generic unix application that is installed on most linux server installations. It is usually set to run via cron and its configuration file is stored in /etc/ most of the time.

/etc/logrotate.conf

In order to rotate your Zope logs try adding the following to logrotate.conf

(replace -> with tabs)

/usr/local/zope/logs/Z2.log {
-> rotate 20
-> compress
-> size=100k
-> sharedscripts
-> postrotate
-> -> /bin/kill -s SIGUSR2 `cat /usr/local/zope/var/Z2.pid`
-> endscript
}

This is set to compress and rotate your logs weekly leaving 20 past rotations when the log file gets over 100k. It is also telling Zope to restart the Z2.log when it is done.

Remember that your Zope installation could be in a different location. This example was set up for a Zope 2.7+ where the log files are put in their own directory.

 

Home Help Center Zope & Plone FAQs How do you rotate Zope logs with logrotate?