From 798240f968de05da72691cf23474a92da62e931a Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Sat, 30 May 2026 22:10:03 +0200 Subject: [PATCH] chore: add Django logging config to route errors to stderr/Docker logs Co-Authored-By: Claude Sonnet 4.6 --- plantdb/settings.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/plantdb/settings.py b/plantdb/settings.py index b0489c6..ed8ac4b 100644 --- a/plantdb/settings.py +++ b/plantdb/settings.py @@ -75,3 +75,29 @@ PLANTNET_API_KEY = os.environ.get('PLANTNET_API_KEY', '') _trusted = os.environ.get('CSRF_TRUSTED_ORIGINS', '') if _trusted: CSRF_TRUSTED_ORIGINS = [o.strip() for o in _trusted.split(',')] + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'console': { + 'class': 'logging.StreamHandler', + }, + }, + 'root': { + 'handlers': ['console'], + 'level': 'WARNING', + }, + 'loggers': { + 'django': { + 'handlers': ['console'], + 'level': 'WARNING', + 'propagate': False, + }, + 'plants': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + }, +}