Python logging and ThreadingTCPServer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel

    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
  • Vinay Sajip

    #2
    Re: Python logging and ThreadingTCPSer ver

    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



    Regards,

    Vinay Sajip

    Comment

    Working...