All you can do now is write the number of rows of SQL errors into a text file
How do I write the wrong number of lines in the same way? Or would you like to write the entire PHP error message in the file?
The solution gives a big direction.
Reply content:
All you can do now is write the number of rows of SQL errors into a text file
How do I write the wrong number of lines in the same way? Or would you like to write the entire PHP error message in the file?
The solution gives a big direction.
Exception
load the error with the object and throw it out
- The outermost use
try catch
or set_exception_handler
capture, the output of friendly errors while recording Exception
information (including the full callstack, which has all the parameters, may be very large need to streamline)
- Error can be converted to
ErrorException
walk the same processing
For example, I plant through MongoDB to record the log, which is a certain day error
"54d1d4e39dce4f834949f0e9": {"_id": {"$id": "54d1d4e39dce4f834949f0e9"}, "message": "Site.error", "context": {"UID": null, "uri": "\/login\/wechat\/get-userinfo", " Exception ": {" Class ":" Errorexception "," message ":" Undefined Index:openid ", "File": "\/data\/deploy\/site\/20150130-150624\/src\/controller\/passport\/oauth\/wechatoauth.php:102", " Trace ": [" \/data\/deploy\/site\/20150130-150624\/src\/controller\/passport\/oauth\/wechatoauth.php:102 "," {\ "function\": \ "getuserinfo\", \ "class\": \ "Xxxx\\\\site\\\\controller\\\\passport\\\\oauth\\\\wechat Oauth\ ", \" type\ ": \":: \ ", \" Args\ ": []}", "\/data\/deploy\/site\/20150130-150624\/vendor\/slim\/slim\/slim \/route.php:462 "," \/data\/deploy\/site\/20150130-150624\/vendor\/slim\/slim\/slim\/slim.php:1326 ", "\/data\/deploy\/site\/20150130-150624\/vendor\/slim\/slim\/slim\/middleware\/flash.php:85 "," \/data\/deploy\/s Ite\/20150130-150624\/vendor\/slim\/slim\/slim\/middleware\/methodoverride.php:92 "," \/data\/deploy\/si te\/20150130-150624\/vendor\/slim\/slim\/slim\/slim.php:1271 "," \/data\/deploy\/site\/20150130-150624\/ Public\/index.php:11 "]}," _trace ": [" #0 Xxxx\\log\\log->log () @ \/data\/deploy\/site\/20150130-150624\/vendor\/psr\/log\/psr\/log\/abstractlogger.php:80 "," #1 Psr\\Log\\Ab Stractlogger->warning () @ \/data\/deploy\/site\/20150130-150624\/src\/router.php:194 "," #2 XXXX\\Site\\R Outer::xxxx\\site\\{closure} () @: "," #3 Call_user_func_array () @ \/data\/deploy\/site\/20150130-150624\/ve ndor\/slim\/slim\/slim\/slim.php:656 "," #4 Slim\\slim->callerrorhandler () @ \/data\/deploy\/site\/201501 30-150624\/vendor\/slim\/slim\/slim\/slim.php:638 "," #5 slim\\slim->error () @ \/data\/deploy\/site\/20150130-150624\/vendor\/sli m\/slim\/slim\/slim.php:1347 "," #6 Slim\\slim->call () @ \/data\/deploy\/site\/20150130-150624\/vendor\/s Lim\/slim\/slim\/middleware\/flash.php:85 "," #7 Slim\\middleware\\flash->call () @ \/data\/deploy\/site\/ 20150130-150624\/vendor\/slim\/slim\/slim\/middleware\/methodoverride.php:92 "," #8 Slim\\Middleware\\Method Override->call () @ \/data\/deploy\/site\/20150130-150624\/vendor\/slim\/slim\/slim\/slim.php:1271 "," #9 Slim\\slim->run () @ \/data\/deploy\/site\/20150130-150624\/public\/index.php:11 "," #10 {main} " ]}, "Level": "Level_name": "WARNING", "channel": "Main", "datetime": { "SEC": 1423037667, "USEC": 0}, "Extra": []},
Landing judgment is not accurate, trust return results have OpenID caused by notice, do not look at the code can see it
Error_log (), can you?