Search code examples
plonezope

Log rotation with Plone


The log rotation for Plone product installation would be a nice feature. What are the current best practices regarding the log rotation integration into Plone?

I found this article: http://encolpe.wordpress.com/2010/06/17/how-to-get-log-files-rotate-in-zope-with-buildout/ but as there are no documentation on plone.org I'd like to ping the community for the good known best practices not to fill up their hard disks.


Solution

  • Similar to what Laurence said above but keeps size under 10mb and saves only 1 old file.

    <eventlog> 
       level INFO 
       <logfile>
         path /path/to/plone4/var/log/client1.log
         max-size 10mb
         old-files 1
       </logfile>
    </eventlog>
    

    plone.recipe.zope2instance can generate this now. For example, you can specify the following options:

    event-log-max-size = 10mb
    event-log-old-files = 3