From 8cc32be33fde25671c82098003c1310758ffb866 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 2 Jan 2024 23:13:55 +0000 Subject: [PATCH] Add logging config --- yamdl_playground/settings.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/yamdl_playground/settings.py b/yamdl_playground/settings.py index 4f471bf..0c69aec 100644 --- a/yamdl_playground/settings.py +++ b/yamdl_playground/settings.py @@ -126,3 +126,37 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DATABASE_ROUTERS = [ "yamdl.router.YamdlRouter", ] + +LOGGING = { + "version": 1, + "disable_existing_loggers": False, + "handlers": { + "console": { + "class": "logging.StreamHandler", + "formatter": "verbose" + }, + }, + "formatters": { + "verbose": { + # Mostly copied from gunicorn + "format": "%(asctime)s [%(process)d] [%(name)s] [%(levelname)s] %(message)s", + "datefmt": "[%Y-%m-%d %H:%M:%S %z]", + } + }, + "root": { + "handlers": ["console"], + "level": "WARNING", + }, + "loggers": { + "django": { + "handlers": ["console"], + "level": "INFO", + "propagate": False, + }, + "yamdl": { + "handlers": ["console"], + "level": "INFO", + "propagate": False, + }, + }, +}