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. |