Description
Environment
How do you use Sentry?
self-hosted/on-premise
sentry/sdk 3.1.1
sentry/sentry 3.4.0
sentry/sentry-symfony 4.2.7
Steps to Reproduce
Have a symfony project with deprecations:
Run console command which triggers deprecation e.g.:
bin/console cache:clear
Output is normally:
Install sentry / sentry bundle run again:
bin/console cache:clear
It looks for me there is some conflicts between symfony error handler (think it handles also deprecations) and the sentry error handler.
In our case we already had disabled the error_listener
but it does not have any effects depending on sentry symfony monolog integration:
config/packages/sentry.yaml
sentry:
dsn: "%env(SENTRY_DSN)%"
register_error_listener: false # Disable ErrorListener to avoid duplicated events because of monolog handler
options:
attach_stacktrace: true # Attach stacktrace to monolog events that do not include an exception
send_default_pii: true # Include personally identifiable information like user, cookies and headers
integrations:
- 'Sentry\Integration\IgnoreErrorsIntegration'
# monolog configuration for sentry
# see also: https://docs.sentry.io/platforms/php/guides/symfony/
monolog:
handlers:
sentry:
type: sentry
level: !php/const Monolog\Logger::ERROR
hub_id: Sentry\State\HubInterface
services:
Monolog\Processor\PsrLogMessageProcessor:
tags: { name: monolog.processor, handler: sentry }
Sentry\Integration\IgnoreErrorsIntegration:
arguments:
$options:
ignore_exceptions:
- 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'
This issue is maybe related to: #337 and maybe a register_error_handler: false
suggested by @Jean85 could fix this issue. But I'm not sure 100% sure it seems to appear only since symfony 5.4/6.0 release and the other issue seems to be older.
Expected Result
Do not output the deprecation notices.
Actual Result
Outputs the deprecation notices.