• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

#2
[eluser]FinalFrag[/eluser]
*bump* c'mon people, help me out here...

#3
[eluser]yelirekim[/eluser]
did you set the log_threshold in config.php? it won't even try to log things in the first place if you don't have it set to something besides zero.

#4
[eluser]dobbler[/eluser]
Any luck with this? I need to set up the same thing..


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.