From b05c2052e147feccf84c6d229d328bd0dc9a6be6 Mon Sep 17 00:00:00 2001 From: Selwin Ong Date: Tue, 5 Aug 2014 12:50:51 +0700 Subject: [PATCH] Capture more data when logging errors. --- rq/worker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rq/worker.py b/rq/worker.py index 59c1624..acecd42 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -526,7 +526,12 @@ class Worker(object): """Walks the exception handler stack to delegate exception handling.""" exc_string = ''.join(traceback.format_exception_only(*exc_info[:2]) + traceback.format_exception(*exc_info)) - self.log.error(exc_string) + self.log.error(exc_string, exc_info=True, extra={ + 'func': job.func_name, + 'args': job.args, + 'kwargs': job.kwargs, + 'queue': job.origin, + }) for handler in reversed(self._exc_handlers): self.log.debug('Invoking exception handler %s' % (handler,))