Re: [Zope-dev] Re: Developing plugins for PluggableAuthService
Chris Withers wrote:
Lennart Regebro wrote:
Chris Withers wrote:
Is there any chance I could tempt you to change these to be Python 2.3 style logging calls?
Sure. remind me of the syntax. :)
import logging
logger = logging.getLogger('event.whatever')
logger.error('whatever',exc_info=1)
You could also read:
http://docs.python.org/lib/module-logging.html
...for a more complete description :-)
cheers,
Chris
OK, Thanks. I'm noticing that (with Zope 2.7.2) when I do this, I do not get the modulname (whatever) nor the exception level WARNING printed to the log. Is this a config error, or am I doing something wrong? Because quite obviously, it should be there, right?
Lennart Regebro wrote:
OK, Thanks. I'm noticing that (with Zope 2.7.2) when I do this, I do not get the modulname (whatever) nor the exception level WARNING printed to the log. Is this a config error, or am I doing something wrong? Because quite obviously, it should be there, right?
You're not doing anything wrong, but arguably it is a config error. You'll need to tweak your log format string for the log in question in zope.conf. The real problem here is that, for some reason that I don't get, zLOG sticks the "WARNING" in the *message* to be logged when it calls the underlying python logger. I wish someone would explain why it does this, as it means you either get double inclusion of the logging level for stuff logged by zLOG or, as you've experienced, a missing level when code logs things the correct way... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
You're not doing anything wrong, but arguably it is a config error.
You'll need to tweak your log format string for the log in question in zope.conf.
The real problem here is that, for some reason that I don't get, zLOG sticks the "WARNING" in the *message* to be logged when it calls the underlying python logger. I wish someone would explain why it does this, as it means you either get double inclusion of the logging level for stuff logged by zLOG or, as you've experienced, a missing level when code logs things the correct way...
Somebody can fix that for 2.8 tomorrow, maybe? But I guess I can check in the LOG changes to PAS now, anyway.
Lennart Regebro wrote:
Somebody can fix that for 2.8 tomorrow, maybe?
Well, zLOG is totally gone is 2.8, I guess it could do with fixing on the 2.7 branch, so please submit a collector entry :-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Lennart Regebro