Skip to content

Commit

Permalink
chore: Normalize LOGGING across Django projects (backoff, django and …
Browse files Browse the repository at this point in the history
…django.request were included from first commit)
  • Loading branch information
jpmckinney committed Jan 8, 2025
1 parent 42c5054 commit d7caad7
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
SECRET_KEY = os.getenv("SECRET_KEY", "i#y833-1r1g^fiq63y_5+v+zmc%ax_6g8$^^o&x%f2bo3omgif")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = not production
DEBUG = os.getenv("DEBUG", str(not production)) == "True"

ALLOWED_HOSTS = [".localhost", "127.0.0.1", "[::1]", "0.0.0.0"] # noqa: S104 # Docker
if "ALLOWED_HOSTS" in os.environ:
Expand Down Expand Up @@ -177,28 +177,19 @@
"handlers": ["console"],
"level": "INFO",
},
"django": {
"handlers": ["console"],
"level": "INFO",
"propagate": False,
},
"django.security.DisallowedHost": {
"handlers": ["null"],
"propagate": False,
},
"django.request": {
"django.db.backends": {
"handlers": ["console"],
"level": "ERROR",
"level": "DEBUG" if production else os.getenv("LOG_LEVEL", "INFO"),
"propagate": False,
},
# The app uses DEBUG messages.
"spoonbill_web": {
"handlers": ["console"],
"level": "DEBUG",
"propagate": False,
},
"backoff": {
"handlers": ["console"],
"level": "INFO",
"level": os.getenv("LOG_LEVEL", "INFO"),
"propagate": False,
},
},
Expand Down

0 comments on commit d7caad7

Please sign in to comment.