Write by logging.FileHandler to one file by many processess

Diez B. Roggisch deets at nospam.web.de
Wed Oct 17 16:10:55 CEST 2007


Alexandre Badez wrote:

> On Oct 17, 3:33 pm, Rafa  Zawadzki <blus... at jabberpl.org> wrote:
>> Hello.
>>
>> 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?
>>
>> Cheers,
>> --
>> bluszczhttp://vegan-planet.net
> 
> Well, there a dummy response: there is no true thread in Python (I
> mean CPython). So there is no problems in this case (cf global
> interpreter lock or GIL).

You didn't read the statement of the OP - he explicitly doesn't ask about
threads, but multiple processes writing to one file.

I presume things get messed up... but I don't know for sure.

Diez



More information about the Python-list mailing list