[Zope-Coders] new zLOG

Chris McDonough chrism@zope.com
26 Nov 2002 14:40:05 -0500


On Tue, 2002-11-26 at 14:13, Casey Duncan wrote:
> This probably qualifies as a "DUH" question, but why can't you just specify 
> the uid to the logger when it is initialized (trick question, eh?). If you 
> are running as root it will just do a chown on the file to the uid specified. 
> Its not as though root won't be able to write to the file.

I think there's a race condition hidden in there somewhere, but
otherwise it's an idea. ;-)

I'd rather eventually instruct zLOG itself to ignore the STUPID_LOG_FILE
envvar for event logging configuration entirely.  Instead, by default,
make the event logger send log messages to stdout and also buffer them
in memory until we've done a told it to do otherwise.

Then, after the app using zLOG does a setuid or whatever else it needs
to accomplish before setting up logging, we can safely configure the
event logger with "real" handlers using info maybe from a config file,
then just flush the "startup" log buffer contents to the "real"
reconfigured log handlers.

This is what the StartupHandler code allows for in the branch.

I think the major complaint against something like this so far is that
it would require changing the apps that use zLOG to need to know
something about logging.  I think this will eventually need to be done
anyway, but one step at a time.

> Or as a even dumber solution, maybe zLOG itself should be configurable to 
> accept an effective user to write the log files as, regardless of the user 
> running Zope.

That's pretty twisted. ;-)

- C