Multiprocessing & Logging

Thibaut merwin.irc at gmail.com
Sun Apr 8 16:55:52 EDT 2012


Le 08/04/2012 02:56, Vinay Sajip a écrit :
> Thibaut<merwin.irc<at>  gmail.com>  writes:
>
>> This is exactly what I wanted, it seems perfect. However I still have a
>> question, from what I understood,
>> I have to configure logging AFTER creating the process, to avoid
>> children process to inherits the logging config.
>>
>> Unless there is a way to "clean" logging configuration in children
>> processes, so they only have one handler : the QueueHandler.
>>
>> I looked at the logging code and it doesn't seems to have an easy way to
>> do this. The problem of configuring the logging
>> after the process creation is that... I can't log during process
>> creation. But if it's too complicated, I will just do this.
>>
> I've updated the 3.2 / 3.3 logging cookbook with an example of what I mean.
> There is a gist of the example script at
>
> https://gist.github.com/2331314/
>
> and the cookbook example should show once the docs get built on docs.python.org.
>
> Regards,
>
> Vinay Sajip
>
>

Thank you very much, the gist example is perfect. This logging system is 
just perfect ! Thanks for your work and explanations. Tips about windows 
/ posix differences  are nice too.

--
Thibaut



More information about the Python-list mailing list