首页 > 解决方案 > 将第三方日志重定向到日志文件 - Python

问题描述

我有一个如下的日志设置。

logging.basicConfig(filename=my_dir+'debug.log', format= message_format, 
datefmt= date_strftime_format,encoding='utf-8', level=logging.DEBUG)

我还编写了第三方应用程序Java,从我的 python 应用程序调用。这提供了很多写入到stdout. 无论如何要将来自此第三方应用程序的日志重定向到我的日志文件。

我仍然想保持我所需的登录stdout。来自 python 应用程序。

标签: pythonpython-2.7logging

解决方案


推荐阅读