Skip to content

Commit d810fcc

Browse files
committed
feature #302 Deprecate "excluded_404s" option (geoffrey-brier)
This PR was merged into the 3.x-dev branch. Discussion ---------- Deprecate "excluded_404s" option replaces #275 fixed symfony/symfony#26969 I have fixed confliects + CS + updated the CHANGELOG Commits ------- f6c8593 Deprecrate "excluded_404s" option
2 parents a7c1046 + f6c8593 commit d810fcc

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 3.4.0 (xxxx-xx-xx)
22

3+
* Deprecate "excluded_404s" option
34
* Flush loggers on `kernel.reset`
45
* Register processors (`ProcessorInterface`) for autoconfiguration (tag: `monolog.processor`)
56
* Expose configuration for the `ConsoleHandler`
@@ -17,6 +18,7 @@
1718
* Added timeouts to the pushover, hipchat, slack handlers
1819
* Dropped support for PHP 5.3, 5.4, and HHVM
1920
* Added configuration for HttpCodeActivationStrategy
21+
* Deprecated "excluded_404s" option for Symfony >= 3.4
2022

2123
## 3.2.0 (2018-03-05)
2224

DependencyInjection/MonologExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Monolog\Processor\ProcessorInterface;
1515
use Monolog\ResettableInterface;
16+
use Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy;
1617
use Symfony\Bridge\Monolog\Processor\TokenProcessor;
1718
use Symfony\Bridge\Monolog\Processor\WebProcessor;
1819
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
@@ -343,6 +344,9 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
343344
if (isset($handler['activation_strategy'])) {
344345
$activation = new Reference($handler['activation_strategy']);
345346
} elseif (!empty($handler['excluded_404s'])) {
347+
if (class_exists(HttpCodeActivationStrategy::class)) {
348+
@trigger_error('The "excluded_404s" option is deprecated in MonologBundle since version 3.4.0, you should rely on the "excluded_http_codes" option instead.', E_USER_DEPRECATED);
349+
}
346350
$activationDef = new Definition('Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy', array(
347351
new Reference('request_stack'),
348352
$handler['excluded_404s'],

Tests/DependencyInjection/MonologExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ public function testLogglyHandler()
383383
$this->assertDICDefinitionMethodCallAt(1, $handler, 'setTag', array('foo,bar'));
384384
}
385385

386+
/** @group legacy */
386387
public function testFingersCrossedHandlerWhenExcluded404sAreSpecified()
387388
{
388389
$container = $this->getContainer(array(array('handlers' => array(

0 commit comments

Comments
 (0)