Created
February 20, 2021 22:19
-
-
Save Kavuti/959e817c3b031cb2d6e2ff34a681b2c3 to your computer and use it in GitHub Desktop.
Gist containing my personal python logging configuration used across many projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[loggers] | |
keys=root | |
[handlers] | |
keys=consoleHandler,fileHandler | |
[formatters] | |
keys=baseFormatter | |
[logger_root] | |
level=DEBUG | |
handlers=consoleHandler,fileHandler | |
formatter=baseFormatter | |
propagate=0 | |
[handler_consoleHandler] | |
class=StreamHandler | |
level=DEBUG | |
formatter=baseFormatter | |
args=(sys.stdout,) | |
[handler_fileHandler] | |
class=logging.handlers.TimedRotatingFileHandler | |
level=DEBUG | |
formatter=baseFormatter | |
args=('logs/log.out', 'midnight', 0, 15) | |
[formatter_baseFormatter] | |
format=%(asctime)s - %(filename)s - %(levelname)s - %(message)s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment