note 102416 rejected from class.errorexception by thiago
[email protected] Sun, 13 Feb 2011 19:04:57 -0800
| Newsgroups | php.notes |
|---|---|
| Message-ID | <[email protected]> |
Note Submitter: weiweiok at qq dot com
----
I think using the ini_set () to set the error_log is inappropriate, because:
1> a lot of virtual space does not support the ini_set () function.
2> When a fatal error occurs, the code may not have time to use ini_set () when it was terminated.
3> In fact all non-fatal errors we can use set_error_handler (), set_exception_handler () and try {... ...} catch
So the key issue is: when a fatal occurs, how do we deal with (although this version of the official business there is very little)
My own view:
First, all non-fatal error, warning, notification, exception, we use the php code to capture and processing.
Second, for fatal error the best approach:
1> Close display_errors in the ini
2> Open log_errors
3> set a file name to error_log (because of the need to consider multiple sites within the server, it can not set an absolute address), so the error log file will be saved to produce the same directory.
4> use php to write a script, time to scan all subdirectories under the specified directory in the error log file that may exist, and to collect aggregate log in to your system and notify the administrator.