Search code examples
pythongunicornsentry

Is there a way to deactivate gunicorn log from sentry?


I have Sentry integrated in a Django project with the aiohttp integration, the app is running with gunicorn. The problem is that the logs in the Sentry are duplicated, one is being sent by gunicorn and the other by the aiohttp logger, can i disable the gunicorn log to prevent this?


Solution

  • Solved, before the init of the sdk:

    from sentry_sdk.integrations.logging import ignore_logger
    ignore_logger('gunicorn.error')