Pyramid忽略了我的日志记录配置

时间:2012-02-29 16:09:44

标签: python logging pyramid

我有一个标准的日志记录配置,如:

[loggers]
keys = root, quoting, sqlalchemy

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_quoting]
level = INFO
handlers =
qualname = quoting

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

金字塔似乎忽略了它,在使用pserve --reload development.ini运行时给了我关于stdout的所有内容。

http://pastebin.com/1Q3Vt9xM

的日志输出示例

日志表示一页加载。我试图过滤掉SQLAlchemy的内容,但想知道我哪里出错了

1 个答案:

答案 0 :(得分:1)

我认为SQLAlchemy引擎配置上的echo=True将转储到stdout并忽略日志记录配置。这可能就是你所看到的。