-
Notifications
You must be signed in to change notification settings - Fork 0
Python Logging
Heath Brown edited this page Jan 24, 2024
·
5 revisions
import logging.config
logger.getLogger("my_app")
logging_config = {
"version": 1,
"disable_existing_loggers" : False,
"filters" : {},
"formatteres" : {},
"handlers" : {},
"loggers" : {}
}
def main():
logging.config.dictConfig(config=logging_config)
...
should not have configuration You can have logging and handlers but no 'configuration'
- Don't log user input (avoid makeLogRecord)
- If you do NEED to sanitize the input before logging
- DO NOT send python objects to logging as pickle