Re: logging producing redundant entries
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: logging producing redundant entries

From: Peter Otten <__peter__@web.de>
Date: Fri Mar 31 2006 - 20:17:10 CEST

Jed Parsons wrote:

> Am I somehow accumulating a growing list of loggers by having this code
> at the top of a zope Extension?

I'd rather look after the number of handlers which is probably growing and
causing your problem. Normally it shouldn't matter how often you repeat
the logging.getLogger(name) call as long as the name is always the same.
For easier diagnosis you can include the loggername ("%(name)s") in the
message.

Do you maintain a hierarchy of loggers (names with dots) with a handler for
each logger? Then it might help to set the loggers' 'propagate' attribute
to False.

Peter
Received on Sun Apr 30 21:48:36 2006