From 4cce74f83d156a9ed8af1ac63b7edcb467f9373a Mon Sep 17 00:00:00 2001 From: David <9059044+Tansito@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:05:10 -0500 Subject: [PATCH] Setup log level depending of the environment --- gateway/main/settings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gateway/main/settings.py b/gateway/main/settings.py index f2beb46ef..8b98d1e01 100644 --- a/gateway/main/settings.py +++ b/gateway/main/settings.py @@ -31,6 +31,9 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = int(os.environ.get("DEBUG", 1)) +# SECURITY WARNING: don't run with debug turned on in production! +LOG_LEVEL = "DEBUG" if int(os.environ.get("DEBUG", 1)) else "WARNING" + ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "*").split(",") # allow connections from any kubernetes pod within the cluster @@ -111,17 +114,17 @@ }, "root": { "handlers": ["console"], - "level": "DEBUG", + "level": LOG_LEVEL, }, "loggers": { "commands": { "handlers": ["console"], - "level": "DEBUG", + "level": LOG_LEVEL, "propagate": False, }, "gateway": { "handlers": ["console"], - "level": "DEBUG", + "level": LOG_LEVEL, "propagate": False, }, },