PHP Ferrari
PHP Ferrari

Reputation: 15664

Error Handling in CI

I read Error Handling but if I use log_message('debug', 'Hi I m in Cart Controller'); or log_message('info', 'Hi I m in Cart Controller'); it does not log any message but work only for log_message('error', 'Hi I m in Cart Controller');

Any idea what my mistake is?

Upvotes: 1

Views: 87

Answers (1)

Mischa
Mischa

Reputation: 43318

You have to set the log threshold in app/config/config.php:

/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to 
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
|   0 = Disables logging, Error logging TURNED OFF
|   1 = Error Messages (including PHP errors)
|   2 = Debug Messages
|   3 = Informational Messages
|   4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 2;

Upvotes: 2

Related Questions