[Zope-Coders] new zLOG
Chris McDonough
chrism@zope.com
25 Nov 2002 12:14:37 -0500
On Mon, 2002-11-25 at 11:34, Guido van Rossum wrote:
> > Maybe this just means that we need to initialize the zLOG event logger
> > to output to standard output or standard error? Currently it's
> > pre-initialized with a "null handler", but it'd be just as easy to send
> > the output to a StreamHandler.
>
> No, it should use the same default as an explict initialize() call.
> Maybe LOG() could call initialize() when it's not yet called???
Here's an example that might help us decide what to do.
When Zope is initialized currently, it typically starts up under daemon
mode. When it's invoked, zdaemon unconditionally imports and writes to
zLOG, which if we were to cause LOG to call initialize, would write a
file. Currently, if Zope is started as root, it does this before the
process changes its effective user. This is a problem because we'd like
the log file to be written not as root but as the effective user.
We can probably change the ordering of Zope initialization to get around
this but the heart of the issue is that every developer then needs to
know to not call zLOG.LOG before we've setuid'd.
IMO, it seems better to be able to control exactly when a disk file is
potentially written (by initializing the logging configuration from the
environment explicitly) instead of perpetually forcing developers to
remember to not call zLOG.LOG before a setuid.
This particular example may be moot with Guido's new zdaemon package,
but this is the state of affairs currently.
- C