From 584beb9863f5a0a6a713eadf3edbc16f47e18b61 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Thu, 9 May 2024 02:25:18 +0200 Subject: [PATCH] Add fill_extra_context option to the symfony documentation (#9824) * Add fill_extra_context option to the symfony documentation * Add also the context data to test example * Update docs/platforms/php/guides/symfony/index.mdx Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --------- Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/php/guides/symfony/index.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/platforms/php/guides/symfony/index.mdx b/docs/platforms/php/guides/symfony/index.mdx index 8f4a5485260cf..6467c9e86078b 100644 --- a/docs/platforms/php/guides/symfony/index.mdx +++ b/docs/platforms/php/guides/symfony/index.mdx @@ -42,6 +42,7 @@ monolog: type: sentry level: !php/const Monolog\Logger::ERROR hub_id: Sentry\State\HubInterface + fill_extra_context: true # Enables sending monolog context to Sentry ``` Additionally, you can register the `PsrLogMessageProcessor` to resolve PSR-3 placeholders in reported messages: @@ -84,7 +85,7 @@ class SentryTestController extends AbstractController public function testLog() { // the following code will test if monolog integration logs to sentry - $this->logger->error('My custom logged error.'); + $this->logger->error('My custom logged error.', ['some' => 'Context Data']); // the following code will test if an uncaught exception logs to sentry throw new \RuntimeException('Example exception.');