Skip to content

Commit

Permalink
Setup log level depending of the environment (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansito authored Nov 16, 2023
1 parent 8fb0086 commit 0196d65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gateway/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
},
},
Expand Down

0 comments on commit 0196d65

Please sign in to comment.