[Zope-dev] zc.zope3recipes:instance: zdaemon/eventlog rotatation

Jim Fulton jim at zope.com
Wed Sep 16 07:03:44 EDT 2009


On Wed, Sep 16, 2009 at 5:28 AM, Christian Zagrodnick <cz at gocept.com> wrote:
> The zc.zope3recipes:instance recipe creates a zdaemon.conf which writes
> the transcript_log and zdaemon's eventlog to the same file. That's
> actually fine.
>
> ZDaemon's reopen_transcript does exactly that: it reopens *only* the
> transcript. So when rotating the logfile (as zc.zope3recipes does it
> via logrotate) ZDaemon messages still go to the old logfile.
>
> I see two obvious ways to fix that:
>
> a) Write ZDaemon's eventlog to stdout

That won't help.  The messages are coming from the controller.

> b) Add a sane way to reopen the logfile.  There is a logreopen command
> in ZDaemon but that actually restarts the daemon process.
>
> Comments? Suggestsions?

The controller needs to be more careful about how it manages it's log
file.  It needs to keep track of the handler used and, when the
transacript file is reopened, it needs to remove the old handler it
was using and create a new one.
This is probably complicated by ZConfig which is managing the logging
configuration.  This is easy to deal with if you're willing to rely on
the logging systems internal details. :)

Jim

-- 
Jim Fulton


More information about the Zope-Dev mailing list