Skip to content

Instantly share code, notes, and snippets.

@zhengxiaowai
Created June 1, 2018 04:12
Show Gist options
  • Save zhengxiaowai/6523f9126e6cf5253671588e3c024663 to your computer and use it in GitHub Desktop.
Save zhengxiaowai/6523f9126e6cf5253671588e3c024663 to your computer and use it in GitHub Desktop.
[loggers]
keys=root
[logger_root]
level=DEBUG
handlers=console,rotating
[handlers]
keys=console,rotating
[handler_console]
class=StreamHandler
level=DEBUG
formatter=simple
args=(sys.stderr,)
[handler_rotating]
class=handlers.RotatingFileHandler
level=INFO
formatter=verbose
args=('logs/app.log', 'a', 10*1024*1024, 10, 'utf-8')
[formatters]
keys=simple,verbose
[formatter_simple]
format=%(levelname)s %(asctime)s %(message)s
datefmt=%Y-%m-%d %H:%M:%S
[formatter_verbose]
format=%(levelname)s %(asctime)s %(module)s %(filename)s %(lineno)s %(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