Skip to content

Instantly share code, notes, and snippets.

@julian-west
Last active October 15, 2022 16:00
Show Gist options
  • Save julian-west/e1b954592da13540a2690ccd827ec925 to your computer and use it in GitHub Desktop.
Save julian-west/e1b954592da13540a2690ccd827ec925 to your computer and use it in GitHub Desktop.
Simple logging configuration file for Python project
[loggers]
keys=root,file
[handlers]
keys=console,file
[formatters]
keys=console,file
[logger_root]
level=DEBUG
handlers=console,file
[logger_file]
level=DEBUG
handlers=file
qualname=file
[handler_console]
class=StreamHandler
level=DEBUG
formatter=console
args=(sys.stdout,)
[handler_file]
class=FileHandler
level=DEBUG
formatter=file
args=('%(logfilename)s','w',)
[formatter_console]
format=%(asctime)s - %(levelname)s - %(name)s - %(message)s
[formatter_file]
format=%(asctime)s - %(levelname)s - %(name)s - %(funcName)s:%(lineno)d - %(message)s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment