Welcome Guest, Not a member yet? Register   Sign In
Mail on error
#1

[eluser]FinalFrag[/eluser]
Hi all,

I want to extend the error reporting class to send me an e-mail when an error happens. I think I would have to create a class MY_Log to extend the CI_Log class. I have the following code in MY_Log:

Code:
<?
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Log extends CI_Log {
    function MY_Log() {
        parent::CI_Log();
    }
    
    function write_log() {
        parent::write_log();
        mail('[email protected]', 'err', 'err');
    }
}
?>

This doesn't seem to work. Could anyone explain to me why?

I also altered my autoload.php to automaticly load the Log class (but I'm not sure if this is really necessary)...

I'm really confused to which class I have to extend and which functions to overwrite as it seems like there is a global function 'error_log' and a function 'write_log' in the Log class. Which one should I extend?

Hope anyone can help me out on this one...

Thnx in advance, FinalFrag


Messages In This Thread
Mail on error - by El Forum - 09-18-2008, 08:46 AM
Mail on error - by El Forum - 09-19-2008, 04:33 AM
Mail on error - by El Forum - 09-19-2008, 04:00 PM
Mail on error - by El Forum - 10-08-2008, 06:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB