Author David Ruggles
Recipients David Ruggles
Date 2019-01-12.13:55:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org>
In-reply-to
Content
ISSUE: if you add a formatter to QueueHandler any subsequently added handlers will get the formatting added to QueueHandler

CAUSE: as best as I can tell, the code here:
https://github.com/python/cpython/blob/d586ccb04f79863c819b212ec5b9d873964078e4/Lib/logging/handlers.py#L1380
is modifying the record object so when it get passed to the next handler here:
https://github.com/python/cpython/blob/d586ccb04f79863c819b212ec5b9d873964078e4/Lib/logging/__init__.py#L1656
it includes the formatting applied by the QueueHandler's formatter.

I worked around this issue by moving my formatter from the QueueHandler to the QueueListener

I've attached a simple example of the issue

NOTE: I marked this as Python 3.7 because that's what I'm using, but I looked at github and the code is in master so I assume this affects 3.8 too.
History
Date User Action Args
2019-01-12 13:55:17David Rugglessetrecipients: + David Ruggles
2019-01-12 13:55:13David Rugglessetmessageid: <1547301313.72.0.148950825212.issue35726@roundup.psfhosted.org>
2019-01-12 13:55:13David Ruggleslinkissue35726 messages
2019-01-12 13:55:13David Rugglescreate