From 7ef11cf595e30cd8139bff30bbe52f070a61ab21 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Sun, 12 May 2019 10:32:39 +0200 Subject: Annotate some logs in the scheduler with event id This is helpful when debugging using the logs. Change-Id: I28b3583b40dfabd8a975fb4a14ddb382dc3484ab --- zuul/connection/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'zuul/connection') diff --git a/zuul/connection/__init__.py b/zuul/connection/__init__.py index ff0807dac..23c776aca 100644 --- a/zuul/connection/__init__.py +++ b/zuul/connection/__init__.py @@ -14,6 +14,8 @@ import abc +from zuul.lib.logutil import get_annotated_logger + class BaseConnection(object, metaclass=abc.ABCMeta): """Base class for connections. @@ -42,10 +44,10 @@ class BaseConnection(object, metaclass=abc.ABCMeta): self.connection_config = connection_config def logEvent(self, event): - self.log.debug( - 'Scheduling event from {connection}: {event}'.format( - connection=self.connection_name, - event=event)) + log = get_annotated_logger(self.log, event.zuul_event_id) + log.debug('Scheduling event from {connection}: {event}'.format( + connection=self.connection_name, + event=event)) try: if self.sched.statsd: self.sched.statsd.incr( -- cgit v1.2.1