[Zope] They mysteries of logging in zope.

John Morton John Morton <jwm@plain.co.nz>
Thu, 8 Mar 2001 13:42:59 +1300 (NZDT)


In the process of building a new login method for the Login Manager
product, I thought it would be a good idea to have the beast log various=20
indications of state out to syslog for later examination. ZLogger's
interface is nice and easy and it looked like all I had to do to get
logging to go to syslog was to set an environment variable.=20

Unfortunately it just doesn't work that easily. Setting ZSYSLOG to log via
/dev/log causes zope to crash straight away, setting ZSYSLOG_SERVER causes
it to crash after between 10 seconds and a minute, and setting
STUPID_FILE_LOGGER does nothing at all.

Wading into the code I discovered a few things, and made some other
observations:

1. There are no less than three separate logging systems used in Zope -
logging via ZServer, logging via ZLogger and some form of debug logging=20
via DebugLogger. They all seem to have different APIs.

2. ZServer and ZLogger both use a copy each of Sam Rushing's syslog
module, but while ZLogger calls it properly, ZServer simply isn't. It
doesn't appear to pass it a port at all.

3. Further up the line, the code that creates the logging object seems to
pass ZSYSLOG straight through as a server address.

I expect that a pair of patches to ZServer and z2.py will be able to fix
the problem, but I'm interested if anyone has found any other solutions.

John