CodeIgniter Forums

Full Version: extending core class not function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]mardon[/eluser]
Hi I would error log messages send by email. T extend core class in application/core i have MY_Exceptions.php with this code
Code:
<?php
class MY_Exceptions extends CI_Exceptions {

    function __construct(){
   parent::__construct();
}

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

    {  

        $ci =& get_instance();
        $severity = ( ! isset($ci->levels[$severity])) ? $severity : $ci->levels[$severity];

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

        $ci->load->library('email');
        $ci->email->from('[email protected]', 'Server Name');
        $ci->email->to('[email protected]');


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

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

}

where i have mistake, this code isnt function