Description
Symfony version(s) affected
≥ 5.1
Description
#36621 replaced DebugHandlersListener
’s loggers for Monolog’s ones. Then, #49275 introduced the ErrorHandlerConfigurator
but its loggers are configured the same way.
As a result, HttpKernel’s Logger
won’t be passed to the ErrorHandler
, even if you’re not using Monolog. That means eg. deprecations won’t appear in the profiler’s logs panel, but they will always appear in commands output (because ErrorHandler
’s loggers will be BufferingLogger
s).
How to reproduce
In a Symfony project without symfony/monolog-bundle
using the profiler, trigger an error or deprecation and it won’t appear in the profiler’s logs panel.
Possible Solution
ErrorHandlerConfigurator::$logger
and ErrorHandlerConfigurator::$deprecationLogger
could be injected the logger
service by default and only be wired to monolog.logger.php
or monolog.logger.deprecation
if they exist.
Additional Context
No response