[Zope-dev] zLog and stderr

Steve Alexander steve@cat-box.net
Wed, 26 Sep 2001 12:00:51 +0100


Toby Dickenson wrote:

> I have some old python modules which are generating messages from the
> new python 2.1 warning framework. I can easily fix these modules,
> however it has exposed a problem in Zope......

 >
 > The warning framework tries to write to sys.stderr, and my Zope is
 > dying from an exception because stderr has been closed.

I bumped into this with Python 1.5.2, and a print statement in the 
Threading module. This was causing me problems using Xron.

The solution was to use this at the end of the start script:

   >> /some/path/logs/zope_stdout.log 2>&1

I keep a separate script called start_debug that doesn't do this, and 
adds -D to the z2.py switches.


> I think it makes sense that Zope should replace sys.stderr with an
> object that sends messages to zLog, however zLog itself sometimes
> wites to sys.stderr.


I guess it would be nice to specify switches to z2.py to say that stderr 
should go to ZLog, and ZLog's stderr messages should get appended to a 
specified file.

--
Steve Alexander
Software Engineer
Cat-Box limited