473,287 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Write by logging.FileHandler to one file by many processess

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,
--
bluszcz
http://vegan-planet.net
Oct 17 '07 #1
5 2647
On Oct 17, 3:33 pm, Rafa Zawadzki <blus...@jabberpl.orgwrote:
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).

Oct 17 '07 #2
Alexandre Badez wrote:
On Oct 17, 3:33 pm, Rafa Zawadzki <blus...@jabberpl.orgwrote:
>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
Oct 17 '07 #3
En Wed, 17 Oct 2007 11:10:55 -0300, Diez B. Roggisch <de***@nospam.web.de>
escribió:
>On Oct 17, 3:33 pm, Rafa Zawadzki <blus...@jabberpl.orgwrote:
>>>
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

Oct 18 '07 #4
On Oct 18, 4:08 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
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.
The Python logging docs even contain a working example of such a
listening process (receiver):

http://www.python.org/doc/current/li...k-logging.html

Regards,

Vinay Sajip

Oct 23 '07 #5
En Tue, 23 Oct 2007 05:08:11 -0300, Vinay Sajip <vi*********@yahoo.co.uk>
escribi�:
On Oct 18, 4:08 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
>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.

The Python logging docs even contain a working example of such a
listening process (receiver):

http://www.python.org/doc/current/li...k-logging.html
Great!

--
Gabriel Genellina

Oct 23 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: max | last post by:
I have an application which calls a module runx, in runx I import logging and get a logger add handlers. I want to be able to rename the file created by fileHandler. several problems, I can't...
8
by: Steve Erickson | last post by:
I have a logger class that uses the Python logging module. When I call it within a program using the unittest module, I get one line in the log file for the first test, two identical ones for the...
6
by: Ville Vainio | last post by:
Just posting this for the sake of google: Like everyone else, I figured it's time to start using the 'logging' module. I typically want to dump "info" level (and up) log information to...
7
by: Jed Parsons | last post by:
Hi, I'm using the logging module for the first time. I'm using it from within Zope Extensions. My problem is that, for every event logged, the logger is producing multiple identical entries...
1
by: fuzzylollipop | last post by:
I want a FileHandler to only log a single level say for example logging.INFO, and nothing else. do I need to create a custom Handler for this or is this doable with some magic that is not...
3
by: pundarikakshaiah | last post by:
Hi, I am using JDK1.4 logging framework and below are the properties that I have in my logging.properties file to configure logging.. handlers= java.util.logging.FileHandler,...
1
by: Kenneth Love | last post by:
I have a Python logging config file that contains a RotatingFileHandler handler. In the args key, I have hard-coded the log filename. Everything works great. However, I find that I now need to...
6
by: Vyacheslav Maslov | last post by:
Hi all! I have many many many python unit test, which are used for testing some remote web service. The most important issue here is logging of test execution process and result. I strongly...
3
by: guybenron | last post by:
Hey, I have a sort of petty-neurotic question, I'm kinda pedantic and like to keep my log directories clean, and this thing is bothering me to the point of actually posting a question (couldn't...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.