Welcome Guest, Not a member yet? Register   Sign In
Writing errors to database / emailing them
#5

[eluser]davidbehler[/eluser]
Google solves --> Post on StackOverFlow.com:

Make a file MY_Exceptions.php and place it in /application/libraries/:
Code:
class MY_Exceptions extends CI_Exceptions {

    function My_Exceptions()
    {
        parent::CI_Exceptions();
    }

    function log_exception($severity, $message, $filepath, $line)

    {  

        $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];

        log_message('error', 'Severity: '.$severity.'  --> '.$message. ' '.$filepath.' '.$line, TRUE);

        $this->load->library('email');
        $this->email->from('[email protected]', 'Your Name');
        $this->email->to('[email protected]');
        $this->email->cc('[email protected]');
        $this->email->bcc('[email protected]');

        $this->email->subject('error');
        $this->email->message('Severity: '.$severity.'  --> '.$message. ' '.$filepath.' '.$line);

        $this->email->send();
    }

}

Untested but might work Smile


Messages In This Thread
Writing errors to database / emailing them - by El Forum - 08-19-2009, 11:35 AM
Writing errors to database / emailing them - by El Forum - 08-19-2009, 12:32 PM
Writing errors to database / emailing them - by El Forum - 08-19-2009, 12:36 PM
Writing errors to database / emailing them - by El Forum - 08-21-2009, 03:43 AM
Writing errors to database / emailing them - by El Forum - 08-21-2009, 03:49 AM
Writing errors to database / emailing them - by El Forum - 11-06-2009, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB