用Plone记录旋转

Mik*_*maa 4 zope plone

Plone产品安装的日志轮换将是一个很好的功能.有关将日志轮换集成到Plone中的最新实践是什么?

我发现这篇文章:http://encolpe.wordpress.com/2010/06/17/how-to-get-log-files-rotate-in-zope-with-buildout/但也有对Plone的任何文档. org我想ping社区以获得众所周知的最佳做法,不要填满他们的硬盘.

Lau*_*owe 6

ZConfig支持标准库RotatingFileHandlerTimedRotatingFileHandler.以ZConfig测试为例:

<eventlog>
  <logfile>
    path /path/to/file.log
    level debug
    when D
    interval 3
    old-files 11
  </logfile>
</eventlog>
Run Code Online (Sandbox Code Playgroud)

这将每三天滚动一次日志,保留11个旧文件.

您可以使用实例配方中的event-log-custom/access-log-custom参数将这些配置片段放置到您的buildout中.plone.recipe.zope2instance