Improper creating of logger instances or a Memory Leak?

Vinay Sajip vinay_sajip at yahoo.co.uk
Sun Jun 19 10:29:53 EDT 2011


foobar <wjshipman <at> gmail.com> writes:

> I've run across a memory leak in a long running process which I can't
> determine if its my issue or if its the logger.

As Chris Torek said, it's not a good idea to create a logger for each thread. A
logger name represents a place in your application; typically, a module, or
perhaps some part of a module. If you want to include information in the log to
see what different threads are doing, do that using the information provided
here:

http://docs.python.org/howto/logging-cookbook.html#adding-contextual-information-to-your-logging-output

Regards,

Vinay Sajip




More information about the Python-list mailing list