Created
May 23, 2017 14:22
-
-
Save nmpowell/c76dfcd8133b31eb4f3601ef44d9ac00 to your computer and use it in GitHub Desktop.
JSON config file for python logging. See e.g. https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/
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
{ | |
"version": 1, | |
"disable_existing_loggers": "False", | |
"formatters": { | |
"simple": { | |
"format": "# {asctime} {name:8s} {levelname:6s} {message}", | |
"datefmt": "%m/%d/%Y %I:%M:%S %p", | |
"style": "{" | |
} | |
}, | |
"handlers": { | |
"console": { | |
"class": "logging.StreamHandler", | |
"level": "INFO", | |
"formatter": "simple", | |
"stream": "ext://sys.stdout" | |
}, | |
"debug_file_handler": { | |
"class": "logging.handlers.RotatingFileHandler", | |
"level": "DEBUG", | |
"formatter": "simple", | |
"filename": "debug.log", | |
"maxBytes": 10485760, | |
"backupCount": 20, | |
"encoding": "utf8" | |
} | |
}, | |
"loggers": { | |
"subpackagename.modulename": {}, | |
"top_level_module_name": {} | |
}, | |
"root": { | |
"level": "DEBUG", | |
"handlers": ["console", "debug_file_handler"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment