Writing errors to database / emailing them |
[eluser]LinkFox[/eluser]
THis is driving me mad now. Has anyone managed to extend CI's error handling to write all errors to the database and email those bad boys to someone?
[eluser]jcavard[/eluser]
You'll have to paste more information if you expect an answer... What is not working? Do you have code so far%
[eluser]LinkFox[/eluser]
Well, I would like to send any errors that occur in my application to a database table called errors which will allow me to monitor my application errors using reports. I was wondering if anyone had extended or knew of an extension to allow this using CI's existing error handling functions. Thanks
[eluser]itibook[/eluser]
I am new here so there might be something easier, but I think you can easily just use a controller to write to the "log table" where you can record pretty much anything...
[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 { Untested but might work
[eluser]Unknown[/eluser]
add a table in your database as follows: Code: SET FOREIGN_KEY_CHECKS=0; modify the function log_exception($severity, $message, $filepath, $line) as this: add the following line: Code: $this->log_execption_db($severity, $message, $filepath, $line); add the function log_execption_db to the system library Code: function log_execption_db($severity, $message, $filepath, $line){ And "ya esta", all the errors will be stored in database too. Also we could create a new confi item in our application to determines if we would like to stored the errors in DB, in file or in both. |
Welcome Guest, Not a member yet? Register Sign In |