From d661f87f63859ec5283f867edaac3f45083b997a Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 3 Dec 2020 01:03:56 +0100 Subject: [PATCH] reorganized logging. --- src/paperless/settings.py | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/paperless/settings.py b/src/paperless/settings.py index d5c6f5c1a..410b8454a 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -256,26 +256,43 @@ DISABLE_DBHANDLER = __get_boolean("PAPERLESS_DISABLE_DBHANDLER") LOGGING = { "version": 1, "disable_existing_loggers": False, + 'formatters': { + 'verbose': { + 'format': '{levelname} {asctime} {module} {message}', + 'style': '{', + }, + 'simple': { + 'format': '{levelname} {message}', + 'style': '{', + }, + }, "handlers": { - "dbhandler": { + "db": { + "level": "DEBUG", "class": "documents.loggers.PaperlessHandler", }, - "streamhandler": { - "class": "logging.StreamHandler" + "console": { + "level": "WARNING", + "class": "logging.StreamHandler", + "formatter": "verbose", } }, + "root": { + "handlers": ["console"], + "level": "DEBUG", + }, "loggers": { "documents": { - "handlers": ["dbhandler", "streamhandler"], - "level": "DEBUG" + "handlers": ["db"], + "propagate": True, }, "paperless_mail": { - "handlers": ["dbhandler", "streamhandler"], - "level": "DEBUG" + "handlers": ["db"], + "propagate": True, }, "paperless_tesseract": { - "handlers": ["dbhandler", "streamhandler"], - "level": "DEBUG" + "handlers": ["db"], + "propagate": True, }, }, }