有没有办法让请求URI自动添加到error_log()
输出?错误目前看起来像:
[03-Dec-2012 13:56:22] PHP Fatal error: Call to a member function getStories()
on a non-object in /usr/share/php/MyProject/Model/Index.php on line 148
有没有办法在那里获取网址?
答案 0 :(得分:0)
希望这会有所帮助:
function debugErrorHandler($errno, $errstr, $errfile, $errline)
{
if(error_reporting()!==0)
{
switch($errno)
{
default:
error_log("PHP Warning Debug: Server Request URI: " .
print_r($_SERVER["REQUEST_URI"], true));
break;
}
return false; // false -> Execute PHP internal error handler
}
}