RE: [Zope-dev] syslog
I'll admit that I don't know. The ZLogger module makes some noise about syslog, but I dont even know if and when that module is used (as opposed to the zLOG module).
It is actually always used unless Zope is started read-only. Its not easy to follow *how* this happens - and I am still not sure *why* its done this way. As for the how: ZLogger starts out with a from zLog import *, it then sets up the list of standard logger objects, and defines the log_write function. Later, z2.py transplants the log_write function from ZLogger into zLOG, where it is used by the implementation of zLOG.LOG (the usual logging API)
Have you verified this by trying it?
Definitely yes - my syslog filled up with access log information. A question for all syslog users; is it ever useful to send access logs to syslog? (I can't think of good reason, but my syslog zen quotient is still low). Is anyone else even using syslog? Anyway, for anyone else interested, below a patch so that the configuration of access-syslog uses different environment variables to event-syslog. Index: z2.py =================================================================== RCS file: /home/cvs/development/external/Zope2/z2.py,v retrieving revision 1.14 diff -c -2 -r1.14 z2.py *** z2.py 10 Sep 2001 15:32:28 -0000 1.14 --- z2.py 1 Oct 2001 14:35:43 -0000 *************** *** 635,646 **** if READ_ONLY: lg = logger.file_logger('-') # log to stdout ! elif os.environ.has_key('ZSYSLOG'): ! lg = logger.syslog_logger(os.environ['ZSYSLOG']) ! if os.environ.has_key("ZSYSLOG_FACILITY"): ! lg = logger.syslog_logger(os.environ['ZSYSLOG'],facility=os.environ['ZSYSLOG_FACI LITY']) else: ! lg = logger.syslog_logger(os.environ['ZSYSLOG']) ! elif os.environ.has_key('ZSYSLOG_SERVER'): ! (addr, port) = string.split(os.environ['ZSYSLOG_SERVER'], ':') lg = logger.syslog_logger((addr, int(port))) else: --- 635,646 ---- if READ_ONLY: lg = logger.file_logger('-') # log to stdout ! elif os.environ.has_key('ZSYSLOG_ACCESS'): ! lg = logger.syslog_logger(os.environ['ZSYSLOG_ACCESS']) ! if os.environ.has_key("ZSYSLOG_ACCESS_FACILITY"): ! lg = logger.syslog_logger(os.environ['ZSYSLOG_ACCESS'],facility=os.environ['ZSYSL OG_FACILITY']) else: ! lg = logger.syslog_logger(os.environ['ZSYSLOG_ACCESS']) ! elif os.environ.has_key('ZSYSLOG_ACCESS_SERVER'): ! (addr, port) = string.split(os.environ['ZSYSLOG_ACCESS_SERVER'], ':') lg = logger.syslog_logger((addr, int(port))) else:
On Mon, Oct 01, 2001 at 04:14:47PM +0100, Toby Dickenson wrote:
A question for all syslog users; is it ever useful to send access logs to syslog? (I can't think of good reason, but my syslog zen quotient is still low). Is anyone else even using syslog?
It may prove to be useful when you want to do remote logging: you send all to the local syslog which in fact forwards it to a remote syslog server. hth. Jerome Alet
On Mon, 1 Oct 2001 20:53:00 +0200, Jerome Alet <alet@unice.fr> wrote:
On Mon, Oct 01, 2001 at 04:14:47PM +0100, Toby Dickenson wrote:
A question for all syslog users; is it ever useful to send access logs to syslog? (I can't think of good reason, but my syslog zen quotient is still low). Is anyone else even using syslog?
It may prove to be useful when you want to do remote logging: you send all to the local syslog which in fact forwards it to a remote syslog server.
I understand the interest for remote logging of events - thats what I am using syslog for. Does the same apply to access logs too? (that is, the entries which also get written to var/Z2.log) Toby Dickenson tdickenson@geminidataloggers.com
On Wed, 3 Oct 2001, Toby Dickenson wrote:
On Mon, 1 Oct 2001 20:53:00 +0200, Jerome Alet <alet@unice.fr> wrote:
It may prove to be useful when you want to do remote logging: you send all to the local syslog which in fact forwards it to a remote syslog server.
I understand the interest for remote logging of events - thats what I am using syslog for.
Does the same apply to access logs too? (that is, the entries which also get written to var/Z2.log)
Sorry, I don't know. In fact I don't use syslog with Zope, this was just a general answer. Because Apache is often used in front of Zope, it's probably even better (quicker) to let Apache do the access logging and disable it entirely from Zope. bye, Jerome Alet
participants (3)
-
Jerome Alet -
Toby Dickenson -
Toby Dickenson