Skip to content
Advertisement

multiprocessing subprocess log to separate file

My main program logs to its own log file and the sub-process should have its own log file. I replaced the logger object inside the multiprocessing process, but the logging data from the sub-process is additionally redirected to the main log file.

How can I prevent this?

The structure looks like this:

JavaScript

Advertisement

Answer

I am simply translating this answer to fit multiprocessing.

JavaScript
JavaScript

NB. you can also put the filter on a specific handler

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement