From e54b80e061d169044da18c23a2235a3dd4af39b5 Mon Sep 17 00:00:00 2001 From: Col Crunch Date: Fri, 13 Mar 2020 00:33:35 -0400 Subject: [PATCH] Add a common logger (and specific log file) for extensions to utilize. --- .../project_template/project_name/settings/base.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/allianceauth/project_template/project_name/settings/base.py b/allianceauth/project_template/project_name/settings/base.py index 4e1efa02..fdcf679c 100644 --- a/allianceauth/project_template/project_name/settings/base.py +++ b/allianceauth/project_template/project_name/settings/base.py @@ -218,6 +218,14 @@ LOGGING = { 'maxBytes': 1024 * 1024 * 5, # edit this line to change max log file size 'backupCount': 5, # edit this line to change number of log backups }, + 'extension_file': { + 'level': 'INFO', + 'class': 'logging.handlers.RotatingFileHandler', + 'filename': os.path.join(BASE_DIR, 'log/extensions.log'), + 'formatter': 'verbose', + 'maxBytes': 1024 * 1024 * 5, # edit this line to change max log file size + 'backupCount': 5, # edit this line to change number of log backups + }, 'console': { 'level': 'DEBUG', # edit this line to change logging level to console 'class': 'logging.StreamHandler', @@ -234,6 +242,11 @@ LOGGING = { 'handlers': ['log_file', 'console', 'notifications'], 'level': 'DEBUG', }, + 'allianceauth.extensions': { + 'handlers': ['extension_file', 'console'], + 'level': 'DEBUG', + 'propagate': False, + }, 'django': { 'handlers': ['log_file', 'console'], 'level': 'ERROR',