I want error logging in PHP CodeIgniter. How do I enable error logging?
I have some questions:
- What are all the steps to log an error?
- How is an error log file created?
- How to push the error message into log file (whenever an error occurs)?
- How do you e-mail that error to an email address?
CodeIgniter has some error logging functions built in.
$config['log_threshold'] = 1;or use a higher number, depending on how much detail you want in your logs
log_message('error', 'Some variable did not contain a value.');log_exceptions(). You can do this yourself or use this. More info on extending the core hereSee http://www.codeigniter.com/user_guide/general/errors.html