Modified files
requirements.txt
---
+++
@@ -5,4 +5,5 @@
databases[aiosqlite]
python-dotenv
rich
-asgi-correlation-id+asgi-correlation-id
+python-json-logger
storeapi/logging_conf.py
---
+++
@@ -22,9 +22,11 @@
"format": "(%(correlation_id)s) %(name)s:%(lineno)d - %(message)s",
},
"file": {
- "class": "logging.Formatter",
+ "class": "pythonjsonlogger.jsonlogger.JsonFormatter",
"datefmt": "%Y-%m-%dT%H:%M:%S",
- "format": "%(asctime)s.%(msecs)03dZ | %(levelname)-8s | [%(correlation_id)s] %(name)s:%(lineno)d - %(message)s",
+ # For JsonFormatter, the format string just defines what keys are included in the log record
+ # It's a bit clunky, but it's the way to do it for now
+ "format": "%(asctime)s %(msecs)03d %(levelname)s %(correlation_id)s %(name)s %(lineno)d %(message)s",
},
},
"handlers": {