In the Logging Cookbook on Python, there are the following comments in the section "A more elaborate multiprocessing example":
# The worker process configuration is just a QueueHandler attached to the
# root logger, which allows all messages to be sent to the queue.
# We disable existing loggers to disable the "setup" logger used in the
# parent process. This is needed on POSIX because the logger will
# be there in the child following a fork().
# The listener process configuration shows that the full flexibility of
# logging configuration is available to dispatch events to handlers however
# you want.
# We disable existing loggers to disable the "setup" logger used in the
# parent process. This is needed on POSIX because the logger will
# be there in the child following a fork().
What is exactly the problem of having a parent logger in a child process?
The (potential) problem is that if the parent process continues to log as well as the child, they will potentially be logging to the same handlers (because of how fork
works on POSIX) and you can't guarantee that writing to a single file from two processes concurrently will work correctly. See the first paragraph of this section in the cookbook.