Python MultiProcess,日志记录,各种类 [英] Python MultiProcess, Logging, Various Classes

查看:240
本文介绍了Python MultiProcess,日志记录,各种类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试从多个进程登录到单个文件,但是我遇到了很多麻烦.我花了无数个小时在网上寻找东西-stackoverflow和Google,但没有提出任何具体建议.

I am currently trying to log to a single file from multiple processes but I am having a lot of trouble with it. I have spend countless hours looking online -- stackoverflow and Google, but have come up with nothing concrete.

我已阅读:在Python中使用多重处理时,我应该如何登录?

我一直在尝试使用zzzeek的代码,但它不会为我写入文件.我没有特定的执行方式-我一直在尝试所有可能的方式.

I've been trying to use zzzeek's code but it does not write to the file for me. I don't have a specific way I'm doing it -- I've just been trying every way I can.

任何人都可以使用它,并具有示例代码,或者您有其他替代方法.我需要将多个进程记录到同一个文件中.我还想将任何错误从各种类记录到同一文件.但是,我对简单地使多进程工作起来感到满意.

Have any of you got it to work and have sample code, or do you have an alternative way of doing it. I need to log multiple processes to the same file. I would also like to log any errors from various class to the same file. I, however, am satisfied with simple getting the multiprocess one to work.

谢谢

推荐答案

看看这些帖子:

  1. 将日志记录与多处理配合使用
  2. 改进了QueueHandler,QueueListener:处理阻塞的处理程序
  3. logutils:将较早版本的日志记录功能与较早版本一起使用Python版本
  1. Using logging with multiprocessing
  2. Improved QueueHandler, QueueListener: dealing with handlers that block
  3. logutils: Using recent logging features with older Python versions

这篇关于Python MultiProcess,日志记录,各种类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆