|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74621 Catched Exception are logged to log_error
Submitted: 2017-05-21 10:13 UTC Modified: -
From: white at addoma dot de Assigned:
Status: Open Package: Xdebug (PECL)
PHP Version: 5.6.30 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-05-21 10:13 UTC] white at addoma dot de
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)

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

Test script:

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

Expected result:

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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Jun 21 11:01:49 2018 UTC