【发布时间】:2014-01-28 02:11:38
【问题描述】:
我的 Django 设置中有以下日志记录配置。
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format':
'%(levelname)s|%(asctime)s|%(name)s>> %(message)s',
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose',
}
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'ERROR',
'propagate': True,
},
'apps': {
'handlers': ['console'],
'level': 'DEBUG',
},
}
}
使用此配置,我希望我的“应用程序”以 DEBUG 级别登录,而任何其他模块仅记录 ERROR 及以上级别。但我看到来自其他模块的 DEBUG 消息。我该如何解决?
【问题讨论】: