Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

zc.zope3recipes:instance: zdaemon/eventlog rotatation

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


cz at gocept

Sep 16, 2009, 2:28 AM

Post #1 of 3 (235 views)
Permalink
zc.zope3recipes:instance: zdaemon/eventlog rotatation

Hi,

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
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?
--
Christian Zagrodnick · cz[at]gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · fax +49 345 1229889 1
Zope and Plone consulting and development


_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


jim at zope

Sep 16, 2009, 4:03 AM

Post #2 of 3 (209 views)
Permalink
Re: zc.zope3recipes:instance: zdaemon/eventlog rotatation [In reply to]

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
_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


cz at gocept

Sep 17, 2009, 12:43 AM

Post #3 of 3 (197 views)
Permalink
Re: zc.zope3recipes:instance: zdaemon/eventlog rotatation [In reply to]

On 2009-09-16 13:03:44 +0200, Jim Fulton <jim[at]zope.com> said:

> 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.

Well, I think it helps in the way, that the messages are not written to
a logfile. Thus nothing needs to be reopend or rotated. They won't be
stored anyware obviously.

>
>> 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. :)

Eeek :)

Oh I'm not sure if it is complicated. But I'll have a look into it when
I've got some time.


--
Christian Zagrodnick · cz[at]gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · fax +49 345 1229889 1
Zope and Plone consulting and development


_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.