python - 将第三方日志重定向到日志文件 - 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 应用程序。
解决方案
推荐阅读
- tensorflow - GPU 无法识别
- java - 如何通过添加'0'使两个字符数组相等?爪哇
- apache-spark - 等效于 Apache Beam 中的重新分区
- vba - VBA 中有没有办法添加 ListRow 对象并按名称指定列?
- mysql - 列出使用过所有付款方式的任何客户的姓名
- r - 转换 DataFrame(R 或 Pandas)
- java - 如何从 android 应用程序将图像文件上传到 Django?
- python - AttributeError:当我可以将 keras 视为 tensorflow 的模块时,模块“tensorflow”没有属性“keras”
- google-cloud-platform - 使用 terraform 将容器映像从一个 Google 项目复制到另一个
- python - 如果嵌套字典中存在最大值,则在同一字典中打印另一个值