Vinay Sajip added the comment:

This is not a bug - it's how processes work on POSIX. Multiprocessing on POSIX 
generally uses the fork system call, which happens when you create a another 
process via the Process(...) call. At this point, the created process is a copy 
of the original process. When you add the handler *before* the Process(...) 
call, the copy also has the handler already added, so process_logger (which is 
called in the copy) will behave as expected. When you add the handler after the 
Process(...) call, the handler has not been added in the copy, so 
process_logger (which is called in the copy) will not behave as expected.

To avoid this sort of problem, ensure that logging is configured as desired in 
each process (normally, this means doing the logging configuration in code 
which is called (directly or indirectly) from the target=XXX callable which is 
passed to Process.

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

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24717>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to