From 3a4e321ac76cf7da8b25543d3d137d2d03d7d21f Mon Sep 17 00:00:00 2001 From: Deborah Kaplan Date: Fri, 6 Dec 2024 17:19:13 +0000 Subject: [PATCH] chore: fix timing issue with logging overrides Make sure that the call to `get_logger` happens after the configuration file overrides have a chance to set `LOGGING_FORMAT_STRING`. FIXES: APER-3805 --- credentials/settings/production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/credentials/settings/production.py b/credentials/settings/production.py index 43c3e92cd..8b3ad8828 100644 --- a/credentials/settings/production.py +++ b/credentials/settings/production.py @@ -12,9 +12,6 @@ ALLOWED_HOSTS = ["*"] -LOGGING_FORMAT_STRING = "" -LOGGING = get_logger_config(format_string=LOGGING_FORMAT_STRING) - # Keep track of the names of settings that represent dicts. Instead of overriding the values in base.py, # the values read from disk should UPDATE the pre-configured dicts. DICT_UPDATE_KEYS = ("JWT_AUTH",) @@ -50,6 +47,9 @@ # Load the files storage backend settings for django storages vars().update(FILE_STORAGE_BACKEND) +# make sure this happens after the configuration file overrides so format string can be overridden +LOGGING = get_logger_config(format_string=LOGGING_FORMAT_STRING) + if "EXTRA_APPS" in locals(): INSTALLED_APPS += EXTRA_APPS