1
有时可能很难诊断中/大型codeIgniter应用程序中发生的问题。当我们不知道用户如何访问资源时,可能很难重现。这是一个非常方便的脚本。codeigniter:记录错误日志的网址
有时可能很难诊断中/大型codeIgniter应用程序中发生的问题。当我们不知道用户如何访问资源时,可能很难重现。这是一个非常方便的脚本。codeigniter:记录错误日志的网址
脚本由"kirill" in a blog posted on "key2market.com"
提供它记录错误,URI和发布数据到log文件。如果您的应用程序有很多错误,该脚本可能会降低您的服务器速度。
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Exceptions extends CI_Exceptions{
/**
* Constructor
*
*/
function __construct(){
parent::__construct();
}
/**
* Exception Logger
*
* This function logs PHP generated error messages
*
*/
function log_exception($severity, $message, $filepath, $line)
{
$severity = (! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
$message = 'Severity: '.$severity.' –> '.$message. ' '.$filepath.' '.$line.' [URI='.$_SERVER['REQUEST_URI'].']';
if(!empty($_POST)){
$message .= 'POST: ';
foreach($_POST as $key=>$value){
$message .= $key.' => '.$value;
}
}
log_message('error', $message, TRUE);
}
}
// END Exceptions Class
/* End of file Exceptions.php */
/* Location: ./ci_app/core/Exceptions.php */