Skip to content

Commit

Permalink
Add fill_extra_context option to the symfony documentation (#9824)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
alexander-schranz and vivianyentran authored May 9, 2024
1 parent f02c89a commit 584beb9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/platforms/php/guides/symfony/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.');
Expand Down

0 comments on commit 584beb9

Please sign in to comment.