Sentry on Symfony: how to exclude `NotFoundHttpException`

I’m using the SentryBundle to integrate Sentry in my Symfony app.

I don’t want to record "NotFoundExceptions", so I configured the bundle this way:

sentry:
    dsn: '%env(SENTRY_DSN)%'
    register_error_listener: false # Disables the ErrorListener
    monolog:
        error_handler:
            enabled: true
            level: error
    messenger:
        enabled: true # flushes Sentry messages at the end of each message handling
        capture_soft_fails: true # captures exceptions marked for retry too
    options:
        environment: '%kernel.environment%'
#        release: '%env(VERSION)%' #your app version
        excluded_exceptions:
            - SymfonyComponentHttpKernelExceptionNotFoundHttpException

Unfortunately, this seems to be not sufficient as the exceptions continue to be logged in Sentry.

What am I doing wrong?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *