You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#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 BufferingLoggers).
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
The text was updated successfully, but these errors were encountered:
…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
Symfony version(s) affected
≥ 5.1
Description
#36621 replaced
DebugHandlersListener
’s loggers for Monolog’s ones. Then, #49275 introduced theErrorHandlerConfigurator
but its loggers are configured the same way.As a result, HttpKernel’s
Logger
won’t be passed to theErrorHandler
, 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 (becauseErrorHandler
’s loggers will beBufferingLogger
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
andErrorHandlerConfigurator::$deprecationLogger
could be injected thelogger
service by default and only be wired tomonolog.logger.php
ormonolog.logger.deprecation
if they exist.Additional Context
No response
The text was updated successfully, but these errors were encountered: