Skip to content

Commit 359bb27

Browse files
committed
Add args and kwargs to LOG_RECEIVED
1 parent ebeb4a4 commit 359bb27

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

celery/worker/strategy.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33

44
from kombu.asynchronous.timer import to_timestamp
5+
from kombu.utils.encoding import safe_repr
56

67
from celery import signals
78
from celery.app import trace as _app_trace
@@ -151,7 +152,12 @@ def task_message_handler(message, body, ack, reject, callbacks,
151152
if _does_info:
152153
# Similar to `app.trace.info()`, we pass the formatting args as the
153154
# `extra` kwarg for custom log handlers
154-
context = {'id': req.id, 'name': req.name}
155+
context = {
156+
'id': req.id,
157+
'name': req.name,
158+
'args': safe_repr(req.args),
159+
'kwargs': safe_repr(req.kwargs),
160+
}
155161
info(_app_trace.LOG_RECEIVED, context, extra={'data': context})
156162
if (req.expires or req.id in revoked_tasks) and req.revoked():
157163
return

0 commit comments

Comments
 (0)