diff options
author | Tobias Henkel <tobias.henkel@bmw.de> | 2019-05-12 10:32:39 +0200 |
---|---|---|
committer | Tobias Henkel <tobias.henkel@bmw.de> | 2019-05-17 06:06:11 +0200 |
commit | 7ef11cf595e30cd8139bff30bbe52f070a61ab21 (patch) | |
tree | da9bad9f7b5fc4d8ca46802d0f88bd6de602f3e7 /zuul/connection | |
parent | 8b455adca911f1c599b2ea6793a4d01f1c374bff (diff) | |
download | zuul-7ef11cf595e30cd8139bff30bbe52f070a61ab21.tar.gz |
Annotate some logs in the scheduler with event id
This is helpful when debugging using the logs.
Change-Id: I28b3583b40dfabd8a975fb4a14ddb382dc3484ab
Diffstat (limited to 'zuul/connection')
-rw-r--r-- | zuul/connection/__init__.py | 10 |
1 files changed, 6 insertions, 4 deletions
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( |