[eluser]Unknown[/eluser]
add a table in your database as follows:
Code:
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for errores
-- ----------------------------
DROP TABLE IF EXISTS `errores`;
CREATE TABLE `errores` (
`id` int(11) NOT NULL auto_increment,
`Severity` varchar(50) default NULL,
`message` text,
`filepath` varchar(250) default NULL,
`line` varchar(250) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/system/libraries/Exceptions
modify the function log_exception($severity, $message, $filepath, $line) as this:
add the following line:
Code:
$this->log_execption_db($severity, $message, $filepath, $line);
add the function log_execption_db to the system library
Code:
function log_execption_db($severity, $message, $filepath, $line){
$this->ci =& get_instance();
$this->ci->load->database();
$data = array(
'Severity' => $severity ,
'message' => $message ,
'filepath' => $filepath,
'line' => $line
);
$this->ci->db->insert('errores', $data);
}
And "ya esta", all the errors will be stored in database too. Also we could create a new confi item in our application to determines if we would like to stored the errors in DB, in file or in both.