Skip to content

Commit 8db4aa6

Browse files
authored
Merge pull request #280 from mpdude/fix-app-channel
Support the "app" channel in the monolog:channels configuration option
2 parents 8d75cca + 4563821 commit 8db4aa6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

DependencyInjection/Compiler/LoggerChannelPass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ public function process(ContainerBuilder $container)
8181

8282
// create additional channels
8383
foreach ($container->getParameter('monolog.additional_channels') as $chan) {
84+
if ($chan === 'app') {
85+
continue;
86+
}
8487
$loggerId = sprintf('monolog.logger.%s', $chan);
8588
$this->createLogger($chan, $loggerId, $container);
8689
$container->getDefinition($loggerId)->setPublic(true);

Tests/DependencyInjection/Compiler/LoggerChannelPassTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ public function testTagNotBreakingIfNoLogger()
134134
$this->assertEquals(array(), $dummyService->getArguments());
135135
}
136136

137+
public function testChannelsConfigurationOptionSupportsAppChannel()
138+
{
139+
$container = $this->getFunctionalContainer();
140+
141+
$container->setParameter('monolog.additional_channels', array('app'));
142+
$container->compile();
143+
}
144+
137145
private function getContainer()
138146
{
139147
$container = new ContainerBuilder();
@@ -202,6 +210,9 @@ private function getContainerWithSetter()
202210
return $container;
203211
}
204212

213+
/**
214+
* @return ContainerBuilder
215+
*/
205216
private function getFunctionalContainer()
206217
{
207218
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)