From 3fd91ced4cac9c755e382987e959723fd87d7dce Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 13 Feb 2019 14:47:55 +0100 Subject: [PATCH] debian: configure journald filters and formatter (#30613) In order to get logs: * on par with syslog for the message, * with structured fields for requests/tenants informations. --- debian/debian_config_common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/debian_config_common.py b/debian/debian_config_common.py index 6350b41..6120c83 100644 --- a/debian/debian_config_common.py +++ b/debian/debian_config_common.py @@ -168,6 +168,9 @@ if os.path.exists('/run/systemd/journal/socket'): else: LOGGING['handlers']['journald'] = { 'class': 'hobo.journal.JournalHandler', + 'filters': ['request_context'], + 'format': '%(application)s %(levelname)s %(tenant)s %(ip)s %(user)s %(request_id)s' + ' %(message)s', } LOGGING['loggers']['']['handlers'].remove('syslog') LOGGING['loggers']['']['handlers'].append('journald') -- 2.20.1