Files
SUST/sustApp/logging_config.py
2025-01-19 17:10:56 +01:00

24 lines
595 B
Python

import logging.config
from pythonjsonlogger import jsonlogger
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"json": {
"format": "%(asctime)s %(levelname)s %(message)s",
"class": "pythonjsonlogger.jsonlogger.JsonFormatter",
}
},
"handlers": {
"stdout": {
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
"formatter": "json",
}
},
"loggers": {"": {"handlers": ["stdout"], "level": "DEBUG"}},
}
logging.config.dictConfig(LOGGING)