diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 78718d7d..cfda3e63 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -169,6 +169,7 @@ * - newrelic: * - [level]: level name or int value, defaults to DEBUG * - [bubble]: bool, defaults to true + * - [app-name]: new relic app name, default null * * - hipchat: * - token: hipchat api token @@ -292,6 +293,7 @@ public function getConfigTreeBuilder() ->scalarNode('priority')->defaultValue(0)->end() ->scalarNode('level')->defaultValue('DEBUG')->end() ->booleanNode('bubble')->defaultTrue()->end() + ->scalarNode('app-name')->defaultNull()->end() ->booleanNode('include_stacktraces')->defaultFalse()->end() ->scalarNode('path')->defaultValue('%kernel.logs_dir%/%kernel.environment%.log')->end() // stream and rotating ->scalarNode('file_permission') // stream and rotating diff --git a/DependencyInjection/MonologExtension.php b/DependencyInjection/MonologExtension.php index c411d530..812a6cc0 100644 --- a/DependencyInjection/MonologExtension.php +++ b/DependencyInjection/MonologExtension.php @@ -614,10 +614,16 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler $handler['bubble'], )); break; + case 'newrelic': + $definition->setArguments(array( + $handler['level'], + $handler['bubble'], + $handler['app-name'], + )); + break; // Handlers using the constructor of AbstractHandler without adding their own arguments case 'browser_console': - case 'newrelic': case 'test': case 'null': case 'debug': diff --git a/Resources/config/schema/monolog-1.0.xsd b/Resources/config/schema/monolog-1.0.xsd index b01cffb6..17c8d415 100644 --- a/Resources/config/schema/monolog-1.0.xsd +++ b/Resources/config/schema/monolog-1.0.xsd @@ -32,6 +32,7 @@ +