From 4deb156de103e876c8742d7db0aa73f9d8541004 Mon Sep 17 00:00:00 2001 From: HypeMC <2445045+HypeMC@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:31:54 +0100 Subject: [PATCH] Add hub_id and register_error_handler options (#1485) --- .../3.0/config/packages/prod/sentry.yaml | 31 ++++++++++++------- .../4.0/config/packages/sentry.yaml | 11 ++++++- .../4.6/config/packages/sentry.yaml | 15 +++++++++ sentry/sentry-symfony/4.6/manifest.json | 15 +++++++++ 4 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 sentry/sentry-symfony/4.6/config/packages/sentry.yaml create mode 100644 sentry/sentry-symfony/4.6/manifest.json diff --git a/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml b/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml index a5ccf756..5285a224 100644 --- a/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml +++ b/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml @@ -5,18 +5,27 @@ sentry: - Symfony\Component\HttpKernel\Exception\NotFoundHttpException - Symfony\Component\Security\Core\Exception\AccessDeniedException -# If you are using Monolog, you also need these additional configuration and services to log the errors correctly: +# If you are using Monolog, you also need this additional configuration to log the errors correctly: # https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration # register_error_listener: false -# monolog: -# handlers: -# sentry: -# type: service -# id: Sentry\Monolog\Handler +# monolog: +# handlers: +# sentry: +# type: sentry +# level: !php/const Monolog\Logger::ERROR +# hub_id: Sentry\State\HubInterface -# services: -# Sentry\Monolog\Handler: -# arguments: -# $hub: '@Sentry\State\HubInterface' -# $level: !php/const Monolog\Logger::ERROR +# If you are using MonologBundle prior to v3.7, you need to configure the handler as a service instead: + +# monolog: +# handlers: +# sentry: +# type: service +# id: Sentry\Monolog\Handler + +# services: +# Sentry\Monolog\Handler: +# arguments: +# $hub: '@Sentry\State\HubInterface' +# $level: !php/const Monolog\Logger::ERROR diff --git a/sentry/sentry-symfony/4.0/config/packages/sentry.yaml b/sentry/sentry-symfony/4.0/config/packages/sentry.yaml index 416e6b07..48635325 100644 --- a/sentry/sentry-symfony/4.0/config/packages/sentry.yaml +++ b/sentry/sentry-symfony/4.0/config/packages/sentry.yaml @@ -2,10 +2,19 @@ when@prod: sentry: dsn: '%env(SENTRY_DSN)%' -# If you are using Monolog, you also need these additional configuration and services to log the errors correctly: +# If you are using Monolog, you also need this additional configuration to log the errors correctly: # https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration # register_error_listener: false +# monolog: +# handlers: +# sentry: +# type: sentry +# level: !php/const Monolog\Logger::ERROR +# hub_id: Sentry\State\HubInterface + +# If you are using MonologBundle prior to v3.7, you need to configure the handler as a service instead: + # monolog: # handlers: # sentry: diff --git a/sentry/sentry-symfony/4.6/config/packages/sentry.yaml b/sentry/sentry-symfony/4.6/config/packages/sentry.yaml new file mode 100644 index 00000000..18569934 --- /dev/null +++ b/sentry/sentry-symfony/4.6/config/packages/sentry.yaml @@ -0,0 +1,15 @@ +when@prod: + sentry: + dsn: '%env(SENTRY_DSN)%' + +# If you are using Monolog, you also need this additional configuration to log the errors correctly: +# https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration +# register_error_listener: false +# register_error_handler: false + +# monolog: +# handlers: +# sentry: +# type: sentry +# level: !php/const Monolog\Logger::ERROR +# hub_id: Sentry\State\HubInterface diff --git a/sentry/sentry-symfony/4.6/manifest.json b/sentry/sentry-symfony/4.6/manifest.json new file mode 100644 index 00000000..9922cfe2 --- /dev/null +++ b/sentry/sentry-symfony/4.6/manifest.json @@ -0,0 +1,15 @@ +{ + "bundles": { + "Sentry\\SentryBundle\\SentryBundle": ["prod"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + }, + "env": { + "SENTRY_DSN": "" + }, + "conflict": { + "symfony/framework-bundle": "<5.4", + "symfony/monolog-bundle": "<3.7" + } +}