Skip to content

Instantly share code, notes, and snippets.

@jianingy
Last active March 3, 2016 09:53
Show Gist options
  • Save jianingy/5dd1fa8da705d922281b to your computer and use it in GitHub Desktop.
Save jianingy/5dd1fa8da705d922281b to your computer and use it in GitHub Desktop.
python-logging.conf
[loggers]
keys=root,business,business_debug
[handlers]
keys=console,business,business_debug,general
[formatters]
keys=tornado
[logger_root]
handlers=general
[logger_business]
level=INFO
handlers=business
qualname=auditor.business
propagate=0
[logger_business_debug]
level=DEBUG
handlers=business_debug
qualname=auditor.business
propagate=0
[handler_general]
class=logging.FileHandler
level=DEBUG
formatter=tornado
args=('/xxxxx/logs/general.log',)
[handler_business]
class=logging.handlers.RotatingFileHandler
level=INFO
formatter=tornado
args=('/xxxxx/logs/biz.log', 'a', 1048576 * 200, 9)
[handler_business_debug]
class=logging.handlers.RotatingFileHandler
level=DEBUG
formatter=tornado
args=('/xxxxx/logs/biz-debug.log', 'a', 1048576 * 200, 9)
[handler_console]
class=StreamHandler
level=DEBUG
formatter=tornado
args=(sys.stderr,)
[formatter_tornado]
format=<%(process)d>[%(levelname)1.1s %(asctime)s %(module)s:%(lineno)d] %(message)s
datefmt=%y%m%d %H:%M:%S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment