Skip to content

Commit

Permalink
Deprecrate "excluded_404s" option
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-brier authored and lyrixx committed May 16, 2019
1 parent a7c1046 commit f6c8593
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
## 3.4.0 (xxxx-xx-xx)

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

## 3.2.0 (2018-03-05)

Expand Down
4 changes: 4 additions & 0 deletions DependencyInjection/MonologExtension.php
Expand Up @@ -13,6 +13,7 @@

use Monolog\Processor\ProcessorInterface;
use Monolog\ResettableInterface;
use Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy;
use Symfony\Bridge\Monolog\Processor\TokenProcessor;
use Symfony\Bridge\Monolog\Processor\WebProcessor;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Expand Down Expand Up @@ -343,6 +344,9 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
if (isset($handler['activation_strategy'])) {
$activation = new Reference($handler['activation_strategy']);
} elseif (!empty($handler['excluded_404s'])) {
if (class_exists(HttpCodeActivationStrategy::class)) {
@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);
}
$activationDef = new Definition('Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy', array(
new Reference('request_stack'),
$handler['excluded_404s'],
Expand Down
1 change: 1 addition & 0 deletions Tests/DependencyInjection/MonologExtensionTest.php
Expand Up @@ -383,6 +383,7 @@ public function testLogglyHandler()
$this->assertDICDefinitionMethodCallAt(1, $handler, 'setTag', array('foo,bar'));
}

/** @group legacy */
public function testFingersCrossedHandlerWhenExcluded404sAreSpecified()
{
$container = $this->getContainer(array(array('handlers' => array(
Expand Down

0 comments on commit f6c8593

Please sign in to comment.