Got some problems when using logging Filter

Vinay Sajip vinay_sajip at yahoo.co.uk
Mon Nov 21 05:11:17 EST 2011


On Nov 21, 7:15 am, sword <john... at gmail.com> wrote:
>
> Thank you! Maybe I should find out another way to manipulate the log,
> like wrap the getLogger function and add the filter at the first
> time :)

If you are using Python 2.7, 3.2 or later, you can use dictionary-
based configuration - it's fairly painless.

http://docs.python.org/library/logging.config.html#logging.config.dictConfig

If you are using an earlier version of Python, the logutils project
includes the same dictionary-based configuration logic.

http://code.google.com/p/logutils/

Regards,

Vinay Sajip



More information about the Python-list mailing list