note 75724 deleted from function.set-error-handler by nlopess
| From: | nlopess@php.net | Date: | Tue, 19 Jun 2007 12:36:56 +0000 |
| Subject: | note 75724 deleted from function.set-error-handler by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127765@lists.php.net to get a copy of this message | ||
Note Submitter: binadit chief error function
----
We use this simple script to log our application errors:
set_error_handler("error_function");
function error_function($err_nr, $err_msg, $err_file, $err_line) {
//Gebruik de numerieke waarden voor de error
if ($err_nr == E_ERROR OR $err_nr == E_USER_ERROR) {
mysql_query("
INSERT INTO
mice_errors (
id , date , timestamp , file ,
line , message
)
VALUES (
NULL , NOW(), '".time()."', '".$err_file."',
'".$err_line."', '".$err_msg."'
);
");
echo "<p class='error'>Error in file: ".$err_file.", op line:
".$err_line."</p>\n";
echo "<p class='error'>Error occured: ".$err_msg.". This message
has been reported to our projectteam.<br />\n";
}
}
http://www.binadit.nl
http://www.binadit.com
http://www.izipc.nl