[Zope-dev] zLog and stderr

2001-09-26 Thread Toby Dickenson

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

Any thoughts on the right way to fix this?


Toby Dickenson
[EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] zLog and stderr

2001-09-26 Thread Steve Alexander

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 21

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




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] zLog and stderr

2001-09-26 Thread Stefan H. Holek

On Wed, 26 Sep 2001, 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 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.
 
 Any thoughts on the right way to fix this?

AFAIK, setting the STUPID_LOG_FILE envar in the start script will provide 
stdout/stderr to Zope.

Stefan


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] zLog and stderr

2001-09-26 Thread Dieter Maurer

Toby Dickenson writes:
  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.
zLog writes to stderr only when there is no log file defined


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] zLog and stderr

2001-09-26 Thread Dieter Maurer

Stefan H. Holek writes:
  AFAIK, setting the STUPID_LOG_FILE envar in the start script will provide 
  stdout/stderr to Zope.
stderr but not stdout

Long time ago, I switched to STUPID_LOG_FILE=
From this time on, I never again saw a write to stderr
appear outside the log file.

As someone else pointed out, all remaining outputs can be redirected
to a file. Under Unix, it would be ...  xxx 21


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )