Errors mailed vs. Logged |
[eluser]hanji[/eluser]
Hello All Here is my first post on the CI forum! First off.. I'm really digging CI!!! My question is this. Is there a way to have the errors emailed (including server variables) vs. just logged to the server? I've written my own error handling class in the past using set_error_handler(). I would like to not touch the core files, so I'm hoping if there is a way to extend a helper or some other technique to adjust how errors are handled. Thanks! hanji
[eluser]pistolPete[/eluser]
Have a look at the user guide: Extending Core Class Create a file MY_Log.php in ./system/application/libraries/ with the following contents: Code: class MY_Log extends CI_Log {
[eluser]hanji[/eluser]
Hello Thanks for the reply. I'm getting the following error... Code: Fatal error: Call to undefined method CI_Log::ci_input() in /var/www/localhost/htdocs/test/system/application/libraries/MY_Log.php on line 7 Thanks! hanji
[eluser]hanji[/eluser]
Doh.. I see the problem CI_Log vs ci_input. That's corrected, but it's complaining about Call to undefined function get_instance() now? Thanks! hanji
[eluser]therealmaloy[/eluser]
@hanji try this out, replace the function __construct(){} with this one Code: public function MY_Log()
[eluser]pistolPete[/eluser]
[quote author="hanji" date="1234771314"]Doh.. I see the problem CI_Log vs ci_input. That's corrected, but it's complaining about Call to undefined function get_instance() now?[/quote] Are you using PHP4?
[eluser]skunkbad[/eluser]
I may be a little late, but I use a hook: Code: <?php Errors on my development server are shown on screen, Errors on the production server are emailed to me.
[eluser]alive[/eluser]
I am having the same exact problem (and the same exact purpose). Using the following code: Code: class MY_Log extends CI_Log Receiving error message as follows: Fatal error: Call to undefined function get_instance() in /[site info]/system/application/libraries/MY_Log.php on line 16 Any help would be appreciated! |
Welcome Guest, Not a member yet? Register Sign In |