Skip to content

Commit

Permalink
[back] fix: read default log level from server settings if it's present
Browse files Browse the repository at this point in the history
  • Loading branch information
amatissart committed Oct 24, 2024
1 parent e5c96e5 commit b414eb8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@

TWITTERBOT_CREDENTIALS = server_settings.get("TWITTERBOT_CREDENTIALS", {})

if "DJANGO_LOG_LEVEL" in os.environ:
DJANGO_LOG_LEVEL = os.environ["DJANGO_LOG_LEVEL"]
else:
DJANGO_LOG_LEVEL = server_settings.get("DJANGO_LOG_LEVEL", "INFO")

LOGGING = {
"version": 1,
"disable_existing_loggers": False,
Expand All @@ -374,7 +379,7 @@
},
"root": {
"handlers": ["console"],
"level": os.environ.get("DJANGO_LOG_LEVEL", "DEBUG"),
"level": DJANGO_LOG_LEVEL,
},
"loggers": {
"factory": {
Expand Down

0 comments on commit b414eb8

Please sign in to comment.