sentry-symfony
sentry-symfony copied to clipboard
Configuration options have no effect
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which SDK and version?
Currently installed:
- symfony/monolog-bundle: 3.5.0
- sentry-symfony: 3.5.4
- symfony: 3.4.37
The application is Prestashop 1.7.7.4 https://github.com/PrestaShop/PrestaShop
Steps to Reproduce
- I configured sentry in
config_dev.yml
monolog:
handlers:
main:
type: stream
path: '%env(PS_LOG_OUTPUT)%'
level: debug
channels: ["!event"]
sentry:
type: service
id: Sentry\Monolog\Handler
sentry:
dsn: "https://....ingest.sentry.io..."
options:
environment: dev
release: !php/const SENTRY_RELEASE
error_types: "E_ALL & ~E_USER_DEPRECATED"
capture_silenced_errors: false
The options are applied:
$ php bin/console debug:config sentry
Current configuration for extension with alias "sentry"
sentry:
dsn: '...ingest.sentry.io...'
options:
environment: dev
release: '20210713154815'
error_types: 'E_ALL & ~E_USER_DEPRECATED'
capture_silenced_errors: false
class_serializers: { }
in_app_include: { }
in_app_exclude:
- (...)
excluded_exceptions: { }
integrations: { }
prefixes:
- (...)
tags: { }
register_error_listener: true
listener_priorities:
request: 1
sub_request: 1
console: 1
request_error: 128
console_error: 128
worker_error: 99
monolog:
error_handler:
enabled: false
level: DEBUG
bubble: true
messenger:
enabled: false
capture_soft_fails: true
But they have not the accounted effect. Silenced errors are still logged, as are user deprecations.
Expected Result
Despite capture_silenced_errors: false, Errors like filemtime(): stat failed are logged for if (!@filemtime($fileUri) || @filesize($fileUri) === 0) {. I would expect this error to go unnoticed.
Despite error_types: 'E_ALL & ~E_USER_DEPRECATED' , errors like Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine ORM 3.0. are logged for below code, where we have a user deprecation.
@trigger_error(
'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.',
E_USER_DEPRECATED
);
Actual Result
The settings are applied, but do not have the expected effect. Silenced errors are still logged, as are user deprecations.
This is probably due to something on the Monolog bundle side that our. See https://github.com/symfony/monolog-bundle/pull/393 which is included in 3.7.0. See also https://github.com/symfony/monolog-bundle/pull/394 which is in the same tag, and fixed another Sentry-related issue.
Unfortunately, I cannot upgrade to symfony/monolog-bundle 3.7, because PrestaShop is stuck with symfony 3.4. I tried many many configurations to no avail.
Is it possible, that symfony does not take into account changes to app/config/config_dev.yaml? Finally I suspect symfony does not read it's configuration on each request, and that all the tests I made were useless because of that. 😩
It surely may depend on that. Config is parsed and dumped in the cache, so if that doesn't get refreshed, you're right, your tests are invalid.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
I still didn't find a solution. The next major version of Prestashop is using Symfony 4.4, but it will not be released before many months. If ever I would advance a step with this problem, I will get this issue updated
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
I hope this issue will be gone on Prestashop 8.0. I'm not ready to deploy Prestashop 8.0 for now, so I cannot tell if it will work.
For sure it would be great to be able to fully integrate Sentry into Prestashop.
Closing for now, please let us know if you have more information once Prestashop 8.0 was released.