-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #52009 [FrameworkBundle] Configure
logger
as error logger if th…
…e Monolog Bundle is not registered (MatTheCat) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] Configure `logger` as error logger if the Monolog Bundle is not registered | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | Not sure | New feature? | Not sure | Deprecations? | no | Tickets | Fix #51910 | License | MIT Commits ------- b7d25e8 [FrameworkBundle] Configure `logger` as error logger if the Monolog Bundle is not registered
- Loading branch information
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ErrorLoggerCompilerPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class ErrorLoggerCompilerPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasDefinition('debug.debug_handlers_listener')) { | ||
return; | ||
} | ||
|
||
$definition = $container->getDefinition('debug.debug_handlers_listener'); | ||
if ($container->hasDefinition('monolog.logger.php')) { | ||
$definition->replaceArgument(1, new Reference('monolog.logger.php')); | ||
} | ||
if ($container->hasDefinition('monolog.logger.deprecation')) { | ||
$definition->replaceArgument(6, new Reference('monolog.logger.deprecation')); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters