Skip to content

Commit 85b5207

Browse files
authored
Add flag for filling sentry extra context (#430)
1 parent 598b2c5 commit 85b5207

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
*
225225
* - sentry:
226226
* - hub_id: Sentry hub custom service id (optional)
227+
* - [fill_extra_context]: bool, defaults to false
227228
*
228229
* - newrelic:
229230
* - [level]: level name or int value, defaults to DEBUG
@@ -423,6 +424,7 @@ public function getConfigTreeBuilder()
423424
->scalarNode('level')->defaultValue('DEBUG')->end()
424425
->booleanNode('bubble')->defaultTrue()->end()
425426
->scalarNode('app_name')->defaultNull()->end()
427+
->booleanNode('fill_extra_context')->defaultFalse()->end() // sentry
426428
->booleanNode('include_stacktraces')->defaultFalse()->end()
427429
->booleanNode('process_psr_3_messages')->defaultNull()->end()
428430
->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end() // stream and rotating

DependencyInjection/MonologExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
783783
$hub,
784784
$handler['level'],
785785
$handler['bubble'],
786+
$handler['fill_extra_context'],
786787
]);
787788
break;
788789

Tests/DependencyInjection/MonologExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public function testSentryHandlerWhenAHubIsSpecified()
487487
$this->assertDICDefinitionMethodCallAt(1, $logger, 'pushHandler', [new Reference('monolog.handler.sentry')]);
488488

489489
$handler = $container->getDefinition('monolog.handler.sentry');
490-
$this->assertDICConstructorArguments($handler, [new Reference('sentry.hub'), \Monolog\Logger::DEBUG, true]);
490+
$this->assertDICConstructorArguments($handler, [new Reference('sentry.hub'), \Monolog\Logger::DEBUG, true, false]);
491491
}
492492

493493
public function testSentryHandlerWhenAHubAndAClientAreSpecified()

0 commit comments

Comments
 (0)