Skip to content

Commit 43a02f4

Browse files
committed
Fix bug when channels: ~ or channels: [] is used
1 parent 0f3054b commit 43a02f4

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

DependencyInjection/Compiler/LoggerChannelPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ protected function processChannels($configuration)
9595
}
9696

9797
if ('inclusive' === $configuration['type']) {
98-
return $configuration['elements'];
98+
return $configuration['elements'] ?: $this->channels;
9999
}
100100

101101
return array_diff($this->channels, $configuration['elements']);

DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ public function getConfigTreeBuilder()
492492
}
493493
}
494494

495+
if (!count($elements)) {
496+
return null;
497+
}
498+
495499
return array('type' => $isExclusive ? 'exclusive' : 'inclusive', 'elements' => $elements);
496500
})
497501
->end()

DependencyInjection/MonologExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function load(array $configs, ContainerBuilder $container)
5757
foreach ($config['handlers'] as $name => $handler) {
5858
$handlers[$handler['priority']][] = array(
5959
'id' => $this->buildHandler($container, $name, $handler),
60-
'channels' => isset($handler['channels']) ? $handler['channels'] : null
60+
'channels' => empty($handler['channels']) ? null : $handler['channels'] : null
6161
);
6262
}
6363

0 commit comments

Comments
 (0)