Write by logging.FileHandler to one file by many processess

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Oct 18 05:08:19 CEST 2007


En Wed, 17 Oct 2007 11:10:55 -0300, Diez B. Roggisch <deets at nospam.web.de>  
escribió:

>> On Oct 17, 3:33 pm, Rafa  Zawadzki <blus... at jabberpl.org> wrote:
>>>
>>> As I saw in logging source - there is no lock per file during making
>>> emit() (only lock per thread).
>>>
>>> So, my question is - is it safe to log into one file using many
>>> processess uses logging logger?
>
> I presume things get messed up... but I don't know for sure.

Yes, output from several processes comes horribly mixed...
I've avoided it using separate log files for each process; but if that's  
not possible, one could try using syslog or a SocketHandler and a separate  
listening process.

-- 
Gabriel Genellina




More information about the Python-list mailing list