Handling 404 errors with Symfony

I’m using Symfony4, and have thousands of 404 errors (from bots, previous website, etc.)

I’d like to get rid of those in my Sentry logs, and have set up my prod/sentry.yaml like this:

sentry:
    dsn: '%env(SENTRY_DSN)%'
    options:
        curl_method: async

    skip_capture:  # To skip certain exceptions, specify a list below
        - 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'
        #      - 'Symfony\Component\HttpKernel\Exception\BadRequestHttpException'
        - 'Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException'

Now those pages are timing out, before they were showing up in the logs. Any suggests as to the proper way to handle this?

Thanks.

1 Like