From be536c3b403b18427d37275182a4310607f45cc0 Mon Sep 17 00:00:00 2001 From: Gustav Andreasson Date: Fri, 29 Dec 2023 14:16:04 +0100 Subject: [PATCH] Log errors in error.log --- records2/settings.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/records2/settings.py b/records2/settings.py index d5ca22d..023fd73 100644 --- a/records2/settings.py +++ b/records2/settings.py @@ -105,12 +105,18 @@ }, }, "handlers": { - "file": { + "fileDebug": { "level": "DEBUG", "class": "logging.FileHandler", "filename": os.path.join(BASE_DIR, "logs/debug.log"), "formatter": "verbose", }, + "fileError": { + "level": "ERROR", + "class": "logging.FileHandler", + "filename": os.path.join(BASE_DIR, "logs/error.log"), + "formatter": "verbose", + }, "console": { "level": "INFO", "class": "logging.StreamHandler", @@ -124,7 +130,7 @@ "propagate": True, }, "records": { - "handlers": ["file"], + "handlers": ["fileDebug", "fileError"], "level": "DEBUG", "propagate": True, },