CodeIgniter has some error logging functions built in. You can log any errors to system log with function log_message
Also you can set log level in your application/config/config.php
here is the sample settings:
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages|
*/
- Make your /application/logs folder writable
- In /application/config/config.php set
$config['log_threshold'] = 1;
or use a higher number, depending on how much detail you want in your logs
- Use
log_message('error', 'Some variable did not contain a value.');
Hope it will help you.