I’d like to receive error logs via email. For example, if a Warning-level error message should occur, I’d like to get an email about it.
How can I get that working in CodeIgniter?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could extend the Exception core class to do it.
Might have to adjust the reference to CI’s email class, not sure if you can instantiate it from a library like this. I don’t use CI’s email class myself, I’ve been using the Swift Mailer library. But this should get you on the right path.
Make a file MY_Exceptions.php and place it in /application/libraries/ (Or in /application/core/ for CI 2)