Revision: 14485
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at June 5, 2009 07:46 by iloveitaly
Initial Code
function logErrorsErrorHandler($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_USER_ERROR: error_log( "<b>My ERROR</b> [$errno] $errstr<br />\n". " Fatal error on line $errline in file $errfile". ", PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n". "Aborting...<br />\n" ); exit(1); break; case E_WARNING: case E_USER_WARNING: error_log("<b>My WARNING</b> [$errno] $errstr<br />\n"); break; // case E_DEPRECATED: // case E_USER_DEPRECATED: case E_STRICT: break; case E_USER_NOTICE: error_log("<b>My NOTICE</b> [$errno] $errstr<br />\n"); break; default: error_log("Unknown error type: [$errfile:$errline] [$errno] $errstr<br />\n"); break; } /* Don't execute PHP internal error handler */ return true; } ini_set('error_log', 'error_log'); ini_set('log_errors', 'On'); set_error_handler("logErrorsErrorHandler");
Initial URL
Initial Description
Initial Title
Custom PHP Error Handler
Initial Tags
php, error, function
Initial Language
PHP