Log caught exception with stack trace

前端 未结 4 1055
逝去的感伤
逝去的感伤 2020-12-24 05:13

If I don\'t catch an exception in PHP, I get a helpful error message in my error.log file with a stack trace. For example, if I run:



        
4条回答
  •  醉梦人生
    2020-12-24 05:43

    You can use http://php.net/manual/en/function.set-exception-handler.php to register a callback function which would get the message from $e->getMessage(); and dump it to file.

提交回复
热议问题