From b332de14b36b03747eec87a58e94cdbd370069f5 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Wed, 8 Feb 2017 18:22:14 +0000 Subject: [PATCH] Add a root logger to the fedmsg base logging config This alters the logging configuration for all fedmsg applications. It adds a root logger configuration which handles messages that are not covered by other loggers (and which also have ``propagate=False``). This means that all Python modules will now be able to emit log messages, rather than those in the ``fedmsg`` or ``moksha`` Python packages (or other packages that use their loggers). Signed-off-by: Jeremy Cline --- roles/fedmsg/base/templates/logging.py.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/fedmsg/base/templates/logging.py.j2 b/roles/fedmsg/base/templates/logging.py.j2 index 70cdbc91f7..4be3fd9918 100644 --- a/roles/fedmsg/base/templates/logging.py.j2 +++ b/roles/fedmsg/base/templates/logging.py.j2 @@ -237,5 +237,11 @@ config = dict( "handlers": ["console", "mailer"], }, ), + # Root handler that deals with log messages that are not handled by the + # loggers explicitly configured in the `loggers` dict. + root={ + "level": "{{fedmsg_loglevel}}", + "handlers": ["console", "mailer"], + }, ), )