From 39179f527794a684f0e741649f2678e04cdb3d95 Mon Sep 17 00:00:00 2001 From: willi pink Date: Fri, 8 Jul 2022 13:13:53 +0200 Subject: [PATCH] add file logging to /var/log/coinmanager/coinmanager.log and additional output to /var/log/apache2/error.log via wsgi.info --- .../coinmanager/production_settings.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/coinmanager/coinmanager/production_settings.py b/coinmanager/coinmanager/production_settings.py index b043214..a4ed0d8 100644 --- a/coinmanager/coinmanager/production_settings.py +++ b/coinmanager/coinmanager/production_settings.py @@ -133,3 +133,22 @@ STATIC_ROOT = os.path.join(BASE_DIR, 'static/') SECURE_SSL_REDIRECT = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': '/var/log/coinmanager/coinmanager.log', + }, + }, + 'loggers': { + 'django': { + 'handlers': ['file'], + 'level': 'DEBUG', + 'propagate': True, + }, + }, +}