views:

34

answers:

2

Is there any PHP library for handling exceptions/errors(including fatal) in PHP? It should be very configurable, support log to file, send Emails, and have integration with different browsers console.

+3  A: 

the best library I found is Lagger - support FirePHP extension for Firefox and has own extension for Google Chrome console

SeniorDev
A: 

including fatal

So after PHP has crashed trying to untangle the source code, you want to run more PHP code to identify where it went wrong? This is not possible with PHP code.

symcbean
You're wrong. For example, I tested Lagger library with fatal error, and it sent me email with error text and saved error to file log.
SeniorDev
@SeniorDev: Lagger is written in PHP - from http://www.php.net/manual/en/function.set-error-handler.php : "The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING," what you describe is nothing more than what error_log() does.
symcbean
@symcbean And again you're wrong! Lagger uses register_shutdown_function() + error_get_last() to catch all fatal errors! Check the source code http://code.google.com/p/lagger/source/browse/trunk/library/Lagger/Handler/Errors.php#34
SeniorDev
@SeniorDev: I'm getting bored with this. You obviously think that Lagger transcends the limits of an interpreted language. Go and try to recreate what you think Lagger is doing with your own code and you'll find out why you are wrong.
symcbean
@SeniorDev: apologies, still on PHP 5.2 - I was not aware of error_get_last()
symcbean
error_get_last() works on PHP >= 5.2
SeniorDev