Patch for php_error_cb
| From: | Blake Matheny | Date: | Mon, 16 May 2005 19:16:19 +0000 |
| Subject: | Patch for php_error_cb | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-16259@lists.php.net to get a copy of this message | ||
Attached is a small patch that allows for a custom error handler to be
used instead of php_log_err. This is useful for custom logging of error
types that can't be handled with a user-space error handler (such as
E_ERROR, E_PARSE, etc.).
In order to use a custom error handler set error_log to so:/path/to/so
in the php.ini file, where the shared object has a function called
error_handler with the following prototype:
int error_handler(int type,
const char *error_filename,
const unsigned int error_lineno,
const char *format,
va_list args)
error_handler should return a non-zero integer if the error was
successfully handled and zero otherwise.
We are using this patch to log errors to a MySQL database for our defect
tracking system.
Regards,
Blake
--
Blake Matheny
3GUpload.com, Inc.
Director of Technology
317-472-4962 (W)
317-201-2840 (C)
bmatheny@3gupload.com