Python logging and ThreadingTCPServer

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Oct 17 19:33:49 EDT 2008


On Oct 17, 5:48 pm, Daniel <daniel.watr... at gmail.com> wrote:
> 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.lang.python/browse_thread/thread/3fbd36c89119f27f

Regards,

Vinay Sajip



More information about the Python-list mailing list