Skip to content

Commit

Permalink
chore(dev): set DEBUG=True when enabling DB logging (#4755)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Oct 22, 2024
1 parent 038a15a commit d4976d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/app/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,11 @@
LOGGING["loggers"][""]["handlers"].append("azure")

ENABLE_DB_LOGGING = env.bool("DJANGO_ENABLE_DB_LOGGING", default=False)
if ENABLE_DB_LOGGING:
if ENABLE_DB_LOGGING: # pragma: no cover
if not DEBUG:
warnings.warn("Setting DEBUG=True to ensure DB logging functions correctly.")
DEBUG = True

LOGGING["loggers"]["django.db.backends"] = {
"level": "DEBUG",
"handlers": ["console"],
Expand Down

0 comments on commit d4976d1

Please sign in to comment.