-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Debug] PHP 7 Error Exceptions logged twice #16980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, when an exception/error is re-injected to the kernel via terminateWithException, we should display it but not log it, knowing that the error handler already had a chance to lg it (and thus did so). Right? |
That would be the first step yes. |
|
@nicolas-grekas Yes, you should writing Fatal error only once. I don't want to see the same error 2 times, it only clogs up the logs. Thank you. |
Should be fixed by #17202, could you please confirm? |
…nicolas-grekas) This PR was merged into the 2.8 branch. Discussion ---------- [FrameworkBundle] Don't log twice with the error handler | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16980 | License | MIT | Doc PR | - ping @Tobion @yapro does it work as expected with this patch? Commits ------- 5926ff2 [FrameworkBundle] Don't log twice with the error handler
…nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Don't log twice with the error handler | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16980, #17202 | License | MIT | Doc PR | Commits ------- 90d493e [FrameworkBundle] Don't log twice with the error handler
This problem seems to be back again using Symfony 3.3. I get two critical error logs for the same thing.
|
@nicolas-grekas the problem is still there with SE 3.4 rc2 |
Fixed in #25408 |
…handlers (nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [Debug] Fix catching fatal errors in case of nested error handlers | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #8703, #16980 | License | MIT | Doc PR | - Fixing a bug from 2013 :) Commits ------- 27dc9a6 [Debug] Fix catching fatal errors in case of nested error handlers
Can You please check current status?
|
It seems I'm still experiencing this problem too, but with 3 copies of each log. I can't seem to reproduce the issue locally, but its happening in our production environments. config.yml
composer.json
etl.log
|
was this issue being solved? as we are facing the same issue with monolog logging message 3 times |
Uh oh!
There was an error while loading. Please reload this page.
With PHP 7,
\Error
exceptions are logged two times as critical.Here an example of the
TypeEror
.The reason for this is that the
ErrorHandler::handleException
logs the PHP error exception. It than wraps the Throwable in aFatalThrowableError
to let the Kernel exception listeners do their work (which are typehinted against\Exception
, seeGetResponseForExceptionEvent
). Then theExceptionListener
kicks in, which logs theFatalThrowableError
again.One error should not cause multiple error logs. Also the second error log with
Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError
is kinda wrong/irritating because you cannot actually catch theFatalThrowableError
. You have to catch the\Error
or\Throwable
instead.This double logging is in dev environment. In prod env only the second wrong error "Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError" is logged.
The text was updated successfully, but these errors were encountered: