madzak/python-json-logger

Celery: Hide extra kwargs

amns13 opened this issue · 1 comments

When any celery task is finished, Celery prints a log saying that the task succeeded in . It also adds extra information containing the parameters received for the task.

logger.info(fmt, context, extra={'data': context})

As the input parameters can contain sensitive information, we don't want to print this info. Is there anyway that we can hide this in the logs?

Okay. I inherited from JsonFormatter and overrode __init__ to add data to _skip_fields. Still, please let me know if there's a better way. TIA