Re: logging producing redundant entries



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
.



Relevant Pages

  • Re: python logging filters
    ... events in the A hierarchy to go to one place and events in the B ... I find that things usually work OK if I just determine what handlers I ... need and attach them to the appropriate loggers, ... then I use the propagate attribute. ...
    (comp.lang.python)
  • Re: python logging filters
    ... events in the A hierarchy to go to one place and events in the B ... I find that things usually work OK if I just determine what handlers I ... need and attach them to the appropriate loggers, ... then I use the propagate attribute. ...
    (comp.lang.python)
  • Re: python logging filters
    ... events in the A hierarchy to go to one place and events in the B ... I find that things usually work OK if I just determine what handlers I ... need and attach them to the appropriate loggers, ... then I use the propagate attribute. ...
    (comp.lang.python)
  • Re: Logging question
    ... I have embarassing problem using theloggingmodule. ... loggers and handlers. ... Loggers ... one log file for everything, one log file for errors, console, and one ...
    (comp.lang.python)
  • Re: How to log messages _only once_ from all modules ?
    ... but instantiating a handler in an instance ... If you ever create multiple client ... It's generally better to declare module-level loggers via ... place in such a way as to not inadvertently create handlers multiple ...
    (comp.lang.python)