Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class MY_Exceptions extends CI_Exceptions {
function My_Exceptions()
function log_exception($severity, $message, $filepath, $line)
$CI =& get_instance();
$severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
log_message('error', 'Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line, TRUE);
if($CI->config->item('base_url') == '') {
$uri = $CI->uri->uri_string();
$CI->email->from('', 'APP Error');
$CI->email->subject('APP Error [severity: '.$severity.']');
$CI->email->message('Severity: '.$severity.' --> '.$message. ' '.$filepath.' '.$line."\n"."From URL: ".$uri);

This comment has been minimized.

Copy link

@andreychernih andreychernih commented Apr 3, 2012

This might be a slightly better approach:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment