如何调试python日志堆栈

时间:2015-11-18 04:17:25

标签: python logging

我遇到了一个问题,即从应用程序中无法显示记录到特定于模块的记录器的消息。试图重现代码的最小版本神奇地解决了这个问题。

尝试在两个地方列出记录器堆栈中的属性,我得到以下结果:

登录anchor.audit时会打印出DEBUG消息:

# logger, name, level, propagate, helpers
(<logging.Logger object at 0x7ff6cac15850>, 'anchor.audit', 0, True, [])
(<logging.Logger object at 0x7ff6cac15990>, 'anchor', 10, 1, [])
(<logging.RootLogger object at 0x7ff6caccfa10>, 'root', 20, 1, [<logging.StreamHandler object at 0x7ff6c846f310>])

即使在ERROR级别,也不会打印任何内容:

# logger, name, level, propagate, helpers
(<logging.Logger object at 0x7ff6c931ac50>, 'oslo_messaging.notify.notifier', 0, 1, [])
(<logging.RootLogger object at 0x7ff6caccfa10>, 'root', 20, 1, [<logging.StreamHandler object at 0x7ff6c846f310>])

如果notifier位于_LOG.error的同一位置,我将_LOG.parent.error替换为[ERROR] Failed to execute goal on project JooqTest: Could not resolve dependencies for project com.abhi:JooqTest:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.jooq:jooq:jar:3.7.1, org.jooq:jooq- meta:jar:3.7.1, org.jooq:jooq-codegen:jar:3.7.1: Failure to find org.jooq:jooq:jar:3.7.1 in http://artifactory.foo.com/artifactory/all-repos was cached in the local repository, resolution will not be reattempted until the update interval of foo-artifactory-as-mirror has elapsed or updates are forced -> [Help 1] ,我确认根记录器仍能正常运行。

记录器配置中的其他内容会对此产生什么影响?我可以看哪些选项?

0 个答案:

没有答案