Logging to a file and closing it again properly (logging module)

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Jun 14 10:47:49 CEST 2006


Christoph Haas wrote:

> Thanks. That works great. I was looking for a way to close the log file
> using logging.basicConfig but it appears that it's too much magic.
> logging.getLogger() isn't really much more work but gives better
> control.

You may also need to close the handler - removeHandler just removes the
handler from the Logger's internal list.

If there are specific areas in the documentation which you feel are
lacking clarity, please post more specific information. Documentation
patches are especially welcome ;-)

Regards,

Vinay Sajip




More information about the Python-list mailing list