From 3347ac8046b317a7eaf55adeac5970587aab7043 Mon Sep 17 00:00:00 2001 From: Jelle Besseling Date: Sun, 3 Nov 2019 23:44:42 +0100 Subject: [PATCH] Add root logging configuration and improve format Previously no loggers were enabled that concrexit uses. This means that all logs by concrexit code were ignored in production. This commit adds a root logger that will make sure all logs by concrexit and imported packages are logged to the log file. This commit also improves the 'verbose' logging format, which previously contained unneeded information and less specific information on which package was doing the logging. --- website/thaliawebsite/settings/production.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/website/thaliawebsite/settings/production.py b/website/thaliawebsite/settings/production.py index d760d45a..b93e33d9 100644 --- a/website/thaliawebsite/settings/production.py +++ b/website/thaliawebsite/settings/production.py @@ -134,15 +134,10 @@ if os.environ.get('DJANGO_EMAIL_HOST'): LOGGING = { 'version': 1, 'disable_existing_loggers': True, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse', - }, - }, 'formatters': { 'verbose': { - 'format': '%(levelname)s %(asctime)s %(module)s ' - '%(process)d %(thread)d %(message)s' + 'format': '%(asctime)s %(name)s ' + '%(levelname)s %(message)s' }, }, 'handlers': { @@ -154,6 +149,7 @@ LOGGING = { 'logfile': { 'level': 'DEBUG', 'class': 'logging.FileHandler', + 'formatter': 'verbose', 'filename': '/concrexit/log/django.log', } }, @@ -161,7 +157,12 @@ LOGGING = { 'django': { 'handlers': ['console', 'logfile'], 'level': 'INFO', + 'propagate': False, }, + '': { + 'handlers': ['logfile'], + 'level': 'INFO', + } }, } -- GitLab