[Zope-Coders] new zLOG

Guido van Rossum guido@python.org
Mon, 25 Nov 2002 12:20:31 -0500


> > 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 doesn't sound right -- if someone calls LOG(), they expect the
log message to go somewhere, root or not.

Does anybody actually run Zope as root?  AFAIK, all customer projects
that I know of run it as designated user "zope".

> This particular example may be moot with Guido's new zdaemon package,
> but this is the state of affairs currently.  

zdaemon.py calls setuid() before forking off a child process.

But zdaemon.py has its own log file, and I like to see its message
written rather than disappearing.  (This is what got me started on
this in the first place.)

--Guido van Rossum (home page: http://www.python.org/~guido/)