madzak / python-json-logger

Json Formatter for the standard python logger
BSD 2-Clause "Simplified" License
1.7k stars 231 forks source link

Celery: Hide extra kwargs #167

Closed amns13 closed 1 year ago

amns13 commented 1 year ago

When any celery task is finished, Celery prints a log saying that the task succeeded in

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?

amns13 commented 1 year ago

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