79579525

Date: 2025-04-17 14:55:08
Score: 1
Natty:
Report link

For the sake of later searchers, like me, although it is 11 years later, Python now has the logging.handlers.QueueHandler class which supports background threading for log message processing. It is thread-safe even when used by the applications own threads. I found it very easy to learn and use.

Currently, using background QueueHandlers is better practice, particularly for apps that do heavy logging with JSON log formatting. All processing of log formatters is done in a thread so as to not suppress the calling app thread. Good luck.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Paul Painter