Skip to content

Commit ae301f0

Browse files
committed
Include task_id in task_failed log
1 parent d62ee4d commit ae301f0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

django_structlog/celery/receivers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def receiver_task_failure(
137137
**kwargs: Any,
138138
) -> None:
139139
log_vars: dict[str, Any] = {}
140+
log_vars["task_id"] = task_id
140141
self.add_duration_ms(sender, log_vars)
141142
throws = getattr(sender, "throws", ())
142143
if isinstance(exception, throws):

0 commit comments

Comments
 (0)