Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions DependencyInjection/MonologExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,13 +994,7 @@ private function getHandlerClassByType($handlerType)
$v2HandlerTypesAdded = [
'elasticsearch' => 'Monolog\Handler\ElasticaHandler',
'fallbackgroup' => 'Monolog\Handler\FallbackGroupHandler',
'logmatic' => 'Monolog\Handler\LogmaticHandler',
'noop' => 'Monolog\Handler\NoopHandler',
'overflow' => 'Monolog\Handler\OverflowHandler',
'process' => 'Monolog\Handler\ProcessHandler',
'sendgrid' => 'Monolog\Handler\SendGridHandler',
'sqs' => 'Monolog\Handler\SqsHandler',
'telegram' => 'Monolog\Handler\TelegramBotHandler',
];

$v2HandlerTypesRemoved = [
Expand Down
10 changes: 10 additions & 0 deletions Tests/DependencyInjection/FixtureMonologExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ public function testPsr3MessageProcessingDisabledOnNullHandler()
$this->assertNotContainsEquals(['pushProcessor', [new Reference('monolog.processor.psr_log_message')]], $methodCalls, 'The PSR-3 processor should not be enabled');
}

public function testHandlersV2()
{
if (\Monolog\Logger::API < 2) {
$this->markTestSkipped('This test requires Monolog v2');
}
$this->getContainer('handlers');

$this->expectNotToPerformAssertions();
}

public function testPsr3MessageProcessingDisabled()
{
$container = $this->getContainer('process_psr_3_messages_disabled');
Expand Down
12 changes: 12 additions & 0 deletions Tests/DependencyInjection/Fixtures/xml/handlers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:monolog="http://symfony.com/schema/dic/monolog"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/monolog http://symfony.com/schema/dic/monolog/monolog-1.0.xsd">

<monolog:config>
<monolog:handler name="noop" type="noop"/>
</monolog:config>
</container>
4 changes: 4 additions & 0 deletions Tests/DependencyInjection/Fixtures/yml/handlers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
monolog:
handlers:
noop:
type: noop