Python 2.7 Logger不打印** args

时间:2017-05-31 18:40:41

标签: python-2.7 logging

当我这样做时,Logger.error没有打印args:

models.LOGGER.error('ji', {'error_msg':'msg'})

我有一种预感,那就是我的logging.conf文件。根据文件https://docs.python.org/2.7/library/logging.html#logging.Logger.debug

[loggers]
keys=root, appLogger, sentryLogger

[handlers]
keys=consoleHandler

[formatters]
keys=stdFormatter

[logger_root]
level=INFO
handlers=consoleHandler

[logger_appLogger]
level=INFO
handlers=consoleHandler
qualname=appLogger
propagate=0

[logger_sentryLogger]
level=INFO
handlers=consoleHandler
qualname=sentryLogger
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=INFO
formatter=stdFormatter
args=(sys.stdout,)


[formatter_stdFormatter]
format=%(asctime)s - %(name)s: %(levelname)s: %(message)s (%(asctime)s; %(filename)s:%(lineno)d)
datefmt=

0 个答案:

没有答案