擅长:python、mysql、java
<p>不,不支持。来自python<a href="http://docs.python.org/2/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes" rel="noreferrer">logging cookbook</a>:</p>
<blockquote>
<p>Although logging is thread-safe, and logging to a single file from
multiple threads in a single process is supported, <strong>logging to a single
file from multiple processes is not supported</strong>, because there is no
standard way to serialize access to a single file across multiple
processes in Python.</p>
</blockquote>
<p>之后,cookbook建议使用单个socket服务器进程来处理日志,而其他进程则向其发送日志消息。
在<a href="http://docs.python.org/2/howto/logging-cookbook.html#sending-and-receiving-logging-events-across-a-network" rel="noreferrer">Sending and Receiving logging events across a network</a>一节中有一个这种方法的工作示例。</p>