php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74621 Catched Exception are logged to log_error
Submitted: 2017-05-21 10:13 UTC Modified: 2018-08-26 17:00 UTC
From: white at addoma dot de Assigned: cmb (profile)
Status: No Feedback Package: Xdebug
PHP Version: 5.6.30 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
40 - 31 = ?
Subscribe to this entry?

 
 [2017-05-21 10:13 UTC] white at addoma dot de
Description:
------------
I noticed in php 5.6.30 that all thrown Exception are output to log_error.

The only way i found to disable Output/logging this Exception, is to disable log_errors.

I expected, only uncatched Exception are outputed with a backtrace.

This makes using exception as internal Error handling not very usable. If log_error is disabled - no uncatched error is shown.
If enabled...  php commandline output exception , which are handled in the code by an try-Catch are logged. If log_error is redirected to an logfile - i think the logfile is spammed with unnecessary Errors.

Perhaps there should be an option, to only protocol unhandled Exceptions.


I found no documentation of this behavior.

Package: php5
Version: 5.6.30+dfsg-0+deb8u1

php -v 
PHP 5.6.30-0+deb8u1 (cli) (built: Feb  8 2017 08:50:21)


UPDATE:
if xdebug extension is disabled - output disapears. Make this sense ?


Test script:
---------------
<?php


try {
        throw new ErrorException("a");
 }
 catch (Exception $ex) {
         echo "catched and handle Error";
 }





Expected result:
----------------
catched

Actual result:
--------------
PHP ErrorException:  a in test.php on line 7
PHP Stack trace:
PHP   1. {main}() test.php:0
catched


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-13 16:16 UTC] cmb@php.net
-Status: Open +Status: Feedback -Type: Feature/Change Request +Type: Bug -Assigned To: +Assigned To: cmb
 [2018-07-13 16:16 UTC] cmb@php.net
Do you have xdebug.show_exception_trace[1] enabled?

[1] <https://xdebug.org/docs/all_settings#show_exception_trace>
 [2018-08-26 17:00 UTC] cmb@php.net
-Status: Feedback +Status: No Feedback
 [2018-08-26 17:00 UTC] cmb@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 04:01:27 2024 UTC