Created
October 2, 2015 14:24
-
-
Save mesaque/781fea864b9589a569a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set_error_handler("myErrorHandler"); | |
| function myErrorHandler($errno, $errstr, $errfile, $errline){ | |
| switch ($errno) { | |
| case E_USER_ERROR: | |
| file_put_contents('/tmp/debug.log', "[Fatal error]{$errstr} \n", FILE_APPEND); | |
| break; | |
| case E_USER_WARNING: | |
| file_put_contents('/tmp/debug.log', "[WARNING]{$errstr} \n", FILE_APPEND); | |
| break; | |
| case E_USER_NOTICE: | |
| file_put_contents('/tmp/debug.log', "[NOTICE]{$errstr} \n", FILE_APPEND); | |
| break; | |
| default: | |
| file_put_contents('/tmp/debug.log', "[Unknown]{$errstr} \n", FILE_APPEND); | |
| break; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment