473,322 Members | 1,566 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,322 software developers and data experts.

Python logging and ThreadingTCPServer

Hello,

I building an application that consists of several sockets
components. I would like to use logging in them, but I've noticed
some issues with the logs getting mangled. This mangling seems to
happen when different threads attempt to access the same log file.

For example, if a client and a server component are running on the
same box and both try to write to the same physical log file, the
first will write fine, but when the second thread (or process) writes
to the log file it mangles the first part of the log file including
deleting some of the information and adding various strange characters
and space. Sometimes it seems that the first process never is able to
write to the log file after the second process starts writing.

Is this a known issue/bug? Are there any known workarounds?

Thanks,
Daniel
Oct 17 '08 #1
1 1945
On Oct 17, 5:48 pm, Daniel <daniel.watr...@gmail.comwrote:
Hello,

I building an application that consists of several sockets
components. I would like to useloggingin them, but I've noticed
some issues with the logs getting mangled. This mangling seems to
happen when different threads attempt to access the same log file.

For example, if a client and a server component are running on the
same box and both try to write to the same physical log file, the
first will write fine, but when the second thread (or process) writes
to the log file it mangles the first part of the log file including
deleting some of the information and adding various strange characters
and space. Sometimes it seems that the first process never is able to
write to the log file after the second process starts writing.

Is this a known issue/bug? Are there any known workarounds?

Thanks,
Daniel
This has come up before. See for example

http://groups.google.com/group/comp....bd36c89119f27f

Regards,

Vinay Sajip
Oct 17 '08 #2

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

Similar topics

3
by: Frantisek Fuka | last post by:
I am using the standard "logging" module included with Python and it seems it doesn't correctly identify the filename (and thus module name) from where the logging method was called. In fact, no...
5
by: Ritesh Raj Sarraf | last post by:
import os, sys, logging logger = logging.getLogger("my_app") conerr = logging.StreamHandler(sys.stderr) conerr.setLevel(logging.DEBUG) conerr_formatter = logging.Formatter('%(levelname)s...
4
by: siggi | last post by:
Hi all, newbie question: I'd like to try speech synthesis with PythonWin 2.5. Problem ****** according to several instructions, such as found on...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 421 open ( +3) / 3530 closed ( +8) / 3951 total (+11) Bugs : 963 open ( +4) / 6426 closed (+21) / 7389 total (+25) RFE : 255 open...
0
by: Brad Brock | last post by:
Hi list. I have a little problem when using SocketServer.ThreadingTCPServer. I want to make a list of thread-objects generated by the ThreadingTCPServer. How can I get the thread object? Thank...
6
by: Larry Bates | last post by:
Every time I look at the logging module (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I...
1
by: Okko Willeboordse | last post by:
Hello, SocketServer.ThreadingTCPServer accepts connections (clients can connect) before and after it's server_forever method is called, see below for an example. IMHO it should only accept...
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
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: 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...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.