Efficient way of looging in python

Jean-Michel Pichavant jeanmichel at sequans.com
Thu Apr 25 10:32:36 EDT 2013


----- Original Message -----
> Hi,
> 
> I need an efficient way of logging using python.
> My problem statemnt:
> 1. I have multiple processes using the same logging file.
> I need solutions to the following:
> a) If multiple processes are trying to write to the same file, I need
> to prevent that. Otherwise, the logging messages will be puzzling to
> the user as he would see logging messages from one module than may
> be some other following it.
> 
> Please let me know if there is an efficient way to do it.
> 
> Thanks!
> 
> Br,
> Maitrey
> --
> http://mail.python.org/mailman/listinfo/python-list

Everything you need should be explained here
http://docs.python.org/release/3.2/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes

Most of the concepts are applicable to any version of python I've done it with python 2.5. I used some Vinay's code posted on the net to implement a logging server, all my processes are logging to that server which is responsible for writing the file.

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the Python-list mailing list