[issue27837] Logging Cookbook Improvement

Vinay Sajip report at bugs.python.org
Tue Aug 23 12:31:56 EDT 2016


Vinay Sajip added the comment:

> Since a queue isn't necessary for logging with multiprocessing

IMO a queue with QueueHandler/QueueListener is best practice when working with multiprocessing and logging. If you don't use them, things may seem to work some of the time but could fail in certain scenarios. For example, multiprocessing works differently on different platforms such as POSIX and Windows, which can lead to problems with simpler approaches.

There are plenty of simpler examples in the logging tutorial and cookbook, which might be worth reviewing first if you are new to logging in Python.

See this post for a discussion on using logging with multiprocessing:

https://plumberjack.blogspot.co.uk/2010/09/using-logging-with-multiprocessing.html

This was the original source of the example in the cookbook.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27837>
_______________________________________


More information about the Python-bugs-list mailing list