aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-13 12:43:11 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-13 12:43:11 +0100
commit7101ebc1cfc2a356a785acc8d5e3c7c3994f3cdd (patch)
tree405a15ff6008054d4e26e51f13568dc3c6347cb4
parentb1ece908720b346d6518d5379f4151faa7ed1ae9 (diff)
Updates the logging config for debugging
-rw-r--r--config/settings/production.py58
1 files changed, 43 insertions, 15 deletions
diff --git a/config/settings/production.py b/config/settings/production.py
index a0cd8e0..4fab057 100644
--- a/config/settings/production.py
+++ b/config/settings/production.py
@@ -143,36 +143,64 @@ ADMIN_URL = env("DJANGO_ADMIN_URL")
LOGGING = {
"version": 1,
- "disable_existing_loggers": True,
- "formatters": {
- "verbose": {
- "format": "%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s",
- },
- },
+ "disable_existing_loggers": False,
"handlers": {
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
- "formatter": "verbose",
+ },
+ "file": {
+ "level": "DEBUG",
+ "class": "logging.FileHandler",
+ "filename": "/home/django/logfile.log", # Update this path
},
},
- "root": {"level": "INFO", "handlers": ["console"]},
"loggers": {
- "django.db.backends": {
+ "django": {
+ "handlers": ["console", "file"],
"level": "ERROR",
- "handlers": ["console"],
- "propagate": False,
+ "propagate": True,
},
- # Errors logged by the SDK itself
- "sentry_sdk": {"level": "ERROR", "handlers": ["console"], "propagate": False},
- "django.security.DisallowedHost": {
+ "django.request": {
+ "handlers": ["console", "file"],
"level": "ERROR",
- "handlers": ["console"],
"propagate": False,
},
},
}
+# LOGGING = {
+# "version": 1,
+# "disable_existing_loggers": True,
+# "formatters": {
+# "verbose": {
+# "format": "%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s",
+# },
+# },
+# "handlers": {
+# "console": {
+# "level": "DEBUG",
+# "class": "logging.StreamHandler",
+# "formatter": "verbose",
+# },
+# },
+# "root": {"level": "INFO", "handlers": ["console"]},
+# "loggers": {
+# "django.db.backends": {
+# "level": "ERROR",
+# "handlers": ["console"],
+# "propagate": False,
+# },
+# # Errors logged by the SDK itself
+# "sentry_sdk": {"level": "ERROR", "handlers": ["console"], "propagate": False},
+# "django.security.DisallowedHost": {
+# "level": "ERROR",
+# "handlers": ["console"],
+# "propagate": False,
+# },
+# },
+# }
+
# # Sentry
# # ------------------------------------------------------------------------------
# SENTRY_DSN = env("SENTRY_DSN")