No deprecation log messages with monolog #63482
Unanswered
MatthiasKuehneEllerhold
asked this question in
Q&A
Replies: 3 comments
-
|
You need to configure a depreciation channel, see https://github.com/symfony/recipes/blob/main/symfony/monolog-bundle/3.7/config/packages/monolog.yaml as a start |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
you should not register the Monolog ErrorHandler, as this would replace the error handler registered by |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Sorry forgot to say: Im not using the symfony framework. So no bundles etc. Im using these packages independently: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Symfony version(s) affected
7.4
Description
Upgrading my project to Symfony 8.0 lead to a lot of broken code. I didnt know why, because I never got any deprecations.
Ive set
error_reporting(E_ALL)and used the Monolog log handler to write everything to file.Nothing pops up.
I've registered the logger via
Monolog\ErrorHandler::register($logger).In the
Symfony\Component\Console\Applicationline 558 (in v7.4) a function calledtrigger_deprecation()is called which should have notified me, that my code will be broken in 8.0, but I never got it!Turns out:
trigger_deprecation()executes@trigger_error().The monolog error handle compares the (new) value of
error_reporting()toE_USER_DEPRECATEDand wont log it to file. Because with the@theerror_reporting()is now set to 4437 (instead of E_ALL) before!So every deprecation CANT get logged with monolog! They only way to get them to log is NOT using
Monolog\ErrorHandler::register($logger), instead use this:How to reproduce
Possible Solution
No response
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions