Updated documentation links for the sentry Monolog integration#1922
Merged
symfony-recipes-bot merged 1 commit intosymfony:mainfrom Jan 15, 2026
Merged
Updated documentation links for the sentry Monolog integration#1922symfony-recipes-bot merged 1 commit intosymfony:mainfrom
symfony-recipes-bot merged 1 commit intosymfony:mainfrom
Conversation
The old link apparently no longer contains documentation about the Monolog integration.
|
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. sentry/sentry-symfony1.0 vs 3.0diff --git a/sentry/sentry-symfony/1.0/config/packages/prod/sentry.yaml b/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml
index 342036fe..758e9165 100644
--- a/sentry/sentry-symfony/1.0/config/packages/prod/sentry.yaml
+++ b/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml
@@ -1,2 +1,31 @@
sentry:
dsn: '%env(SENTRY_DSN)%'
+ options:
+ excluded_exceptions:
+ - Symfony\Component\HttpKernel\Exception\NotFoundHttpException
+ - Symfony\Component\Security\Core\Exception\AccessDeniedException
+
+# If you are using Monolog, you also need this additional configuration to log the errors correctly:
+# https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/
+# 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:
+# 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/1.0/config/packages/sentry.yaml b/sentry/sentry-symfony/1.0/config/packages/sentry.yaml
deleted file mode 100644
index e94da2d6..00000000
--- a/sentry/sentry-symfony/1.0/config/packages/sentry.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-sentry:
- 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'
diff --git a/sentry/sentry-symfony/1.0/manifest.json b/sentry/sentry-symfony/3.0/manifest.json
index c96ec90e..097e7e84 100644
--- a/sentry/sentry-symfony/1.0/manifest.json
+++ b/sentry/sentry-symfony/3.0/manifest.json
@@ -1,6 +1,6 @@
{
"bundles": {
- "Sentry\\SentryBundle\\SentryBundle": ["all"]
+ "Sentry\\SentryBundle\\SentryBundle": ["prod"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"3.0 vs 4.0diff --git a/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml b/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml
deleted file mode 100644
index 758e9165..00000000
--- a/sentry/sentry-symfony/3.0/config/packages/prod/sentry.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-sentry:
- dsn: '%env(SENTRY_DSN)%'
- options:
- excluded_exceptions:
- - Symfony\Component\HttpKernel\Exception\NotFoundHttpException
- - Symfony\Component\Security\Core\Exception\AccessDeniedException
-
-# If you are using Monolog, you also need this additional configuration to log the errors correctly:
-# https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/
-# 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:
-# 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
new file mode 100644
index 00000000..ebace261
--- /dev/null
+++ b/sentry/sentry-symfony/4.0/config/packages/sentry.yaml
@@ -0,0 +1,29 @@
+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/integrations/monolog/
+# 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:
+# type: service
+# id: Sentry\Monolog\Handler
+
+# services:
+# Sentry\Monolog\Handler:
+# arguments:
+# $hub: '@Sentry\State\HubInterface'
+# $level: !php/const Monolog\Logger::ERROR
+# $bubble: false
diff --git a/sentry/sentry-symfony/3.0/manifest.json b/sentry/sentry-symfony/4.0/manifest.json
index 097e7e84..9e07f9cc 100644
--- a/sentry/sentry-symfony/3.0/manifest.json
+++ b/sentry/sentry-symfony/4.0/manifest.json
@@ -7,5 +7,8 @@
},
"env": {
"SENTRY_DSN": ""
+ },
+ "conflict": {
+ "symfony/framework-bundle": "<5.4"
}
}4.0 vs 4.6diff --git a/sentry/sentry-symfony/4.0/config/packages/sentry.yaml b/sentry/sentry-symfony/4.6/config/packages/sentry.yaml
index ebace261..bb697e2c 100644
--- a/sentry/sentry-symfony/4.0/config/packages/sentry.yaml
+++ b/sentry/sentry-symfony/4.6/config/packages/sentry.yaml
@@ -1,10 +1,16 @@
when@prod:
sentry:
dsn: '%env(SENTRY_DSN)%'
+ # this hooks into critical paths of the framework (and vendors) to perform
+ # automatic instrumentation (there might be some performance penalty)
+ # https://docs.sentry.io/platforms/php/guides/symfony/performance/instrumentation/automatic-instrumentation/
+ tracing:
+ enabled: false
# If you are using Monolog, you also need this additional configuration to log the errors correctly:
# https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/
# register_error_listener: false
+# register_error_handler: false
# monolog:
# handlers:
@@ -12,18 +18,5 @@ when@prod:
# 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:
-# type: service
-# id: Sentry\Monolog\Handler
-
-# services:
-# Sentry\Monolog\Handler:
-# arguments:
-# $hub: '@Sentry\State\HubInterface'
-# $level: !php/const Monolog\Logger::ERROR
-# $bubble: false
+# fill_extra_context: true # Enables sending monolog context to Sentry
+# process_psr_3_messages: false # Disables the resolution of PSR-3 placeholders
diff --git a/sentry/sentry-symfony/4.0/manifest.json b/sentry/sentry-symfony/4.6/manifest.json
index 9e07f9cc..9922cfe2 100644
--- a/sentry/sentry-symfony/4.0/manifest.json
+++ b/sentry/sentry-symfony/4.6/manifest.json
@@ -9,6 +9,7 @@
"SENTRY_DSN": ""
},
"conflict": {
- "symfony/framework-bundle": "<5.4"
+ "symfony/framework-bundle": "<5.4",
+ "symfony/monolog-bundle": "<3.7"
}
}4.6 vs 5.0diff --git a/sentry/sentry-symfony/4.6/config/packages/sentry.yaml b/sentry/sentry-symfony/5.0/config/packages/sentry.yaml
index bb697e2c..dea194c8 100644
--- a/sentry/sentry-symfony/4.6/config/packages/sentry.yaml
+++ b/sentry/sentry-symfony/5.0/config/packages/sentry.yaml
@@ -1,22 +1,39 @@
when@prod:
sentry:
dsn: '%env(SENTRY_DSN)%'
- # this hooks into critical paths of the framework (and vendors) to perform
- # automatic instrumentation (there might be some performance penalty)
- # https://docs.sentry.io/platforms/php/guides/symfony/performance/instrumentation/automatic-instrumentation/
- tracing:
- enabled: false
-
-# If you are using Monolog, you also need this additional configuration to log the errors correctly:
-# https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/
+ options:
+ # Add request headers, cookies, IP address and the authenticated user
+ # see https://docs.sentry.io/platforms/php/data-management/data-collected/ for more info
+ # send_default_pii: true
+ ignore_exceptions:
+ - 'Symfony\Component\ErrorHandler\Error\FatalError'
+ - 'Symfony\Component\Debug\Exception\FatalErrorException'
+#
+# # If you are using Monolog, you also need this additional configuration to log the errors correctly:
+# # https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/
# register_error_listener: false
# register_error_handler: false
-
+#
# monolog:
# handlers:
+# # Use this only if you don't want to use structured logging and instead receive
+# # certain log levels as errors.
# sentry:
-# type: sentry
-# level: !php/const Monolog\Logger::ERROR
-# hub_id: Sentry\State\HubInterface
-# fill_extra_context: true # Enables sending monolog context to Sentry
-# process_psr_3_messages: false # Disables the resolution of PSR-3 placeholders
+# type: service
+# id: Sentry\Monolog\Handler
+#
+# # Use this for structured log integration
+# sentry_logs:
+# type: service
+# id: Sentry\SentryBundle\Monolog\LogsHandler
+#
+# # Enable one of the two services below, depending on your choice above
+# services:
+# Sentry\Monolog\Handler:
+# arguments:
+# $hub: '@Sentry\State\HubInterface'
+# $level: !php/const Monolog\Logger::ERROR
+# $fillExtraContext: true # Enables sending monolog context to Sentry
+# Sentry\SentryBundle\Monolog\LogsHandler:
+# arguments:
+# - !php/const Monolog\Logger::INFO |
fabpot
approved these changes
Jan 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old link apparently no longer contains documentation about the Monolog integration.