瀏覽代碼

Dump args and kwargs in error e-mail

Ask Solem 16 年之前
父節點
當前提交
ef0d40dbf5
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      celery/worker/job.py

+ 4 - 0
celery/worker/job.py

@@ -16,6 +16,8 @@ EMAIL_SIGNATURE_SEP = "-- "
 TASK_FAIL_EMAIL_BODY = """
 Task %%(name)s with id %%(id)s raised exception: %%(exc)s
 
+
+Task was called with args:%%(args)s kwargs:%%(kwargs)s.
 The contents of the full traceback was:
 
 %%(traceback)s
@@ -218,6 +220,8 @@ class TaskWrapper(object):
             "name": task_name,
             "exc": exc_info.exception,
             "traceback": exc_info.traceback,
+            "args": self.args,
+            "kwargs": self.kwargs,
         }
         self.logger.error(self.fail_msg.strip() % context)