[issue44599] Changing logging format for one handler changes it for all

Vinay Sajip report at bugs.python.org
Mon Jul 12 01:39:28 EDT 2021


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

> It looks like an unexpected behavior to me when reading the doc.

Perhaps you missed this?

https://docs.python.org/3/library/logging.html?highlight=exc_text#logging.Formatter.format

"Note that the formatted exception information is cached in attribute exc_text. This is useful because the exception information can be pickled and sent across the wire, but you should be careful if you have more than one Formatter subclass which customizes the formatting of exception information. In this case, you will have to clear the cached value after a formatter has done its formatting, so that the next formatter to handle the event doesn’t use the cached value but recalculates it afresh."

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44599>
_______________________________________


More information about the Python-bugs-list mailing list