php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: white at addoma dot de
New email:
PHP Version: OS:

 

 [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

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC