[issue932563] logging: need a way to discard Logger objects

Vinay Sajip report at bugs.python.org
Sun Jan 6 11:39:18 CET 2008


Vinay Sajip added the comment:

There's probably no need. Fred's initial reason for wanting this (usage
of connection-specific loggers, which would be an anti-pattern in my
book) was later solved by him using an application-specific wrapper.
Also, changes made to logging after this issue was created make it
easier to include context information (e.g. connection IDs) in logging
calls.

So: I don't think it is good behaviour for any application to create a
large (=> potentially unbounded) set of loggers. The number of loggers
created should be dependent on the granularity of logging which the
application developer wants to use. If this approach is followed, the
number of loggers is unlikely to lead to memory hogging by the logging
package. So, I propose to close this ticket now, but anyone can of
course reopen it if they think there is still an issue here which needs
addressing.

I will review the docs to see if I need to clarify that loggers should
not be created on a per-connection (or analogous) basis.

----------
resolution:  -> out of date
status: open -> closed

____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue932563>
____________________________________


More information about the Python-bugs-list mailing list