diff --git a/roles/fedmsg_base/templates/logging.py.j2 b/roles/fedmsg_base/templates/logging.py.j2 index c2d634bb70..de0fe02f42 100644 --- a/roles/fedmsg_base/templates/logging.py.j2 +++ b/roles/fedmsg_base/templates/logging.py.j2 @@ -27,6 +27,9 @@ class ContextInjector(logging.Filter): """ def filter(self, record): + current_process = ContextInjector.get_current_process() + current_hostname = socket.gethostname() + record.host = current_hostname record.proc = current_process record.pid = current_process.pid @@ -67,9 +70,6 @@ class ContextInjector(logging.Filter): return {'name': 'ContextInjector'} -current_process = ContextInjector.get_current_process() -current_hostname = socket.gethostname() - hefty_format = """Message ------- [%(asctime)s][%(name)10s %(levelname)7s]