0

Ok I got confused.

Inside application/config.php it says in comments:

    | 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
|
| You can also pass an array with threshold levels to show individual error types
|
|   array(2) = Debug Messages, without Error Messages

So if I want to get Error and Debug messages and not any Information messages, do I have to set the threshold

$config['log_threshold'] = 2;

or

$config['log_threshold'] = array(1, 2);

Could someone give me some clarification?

ltdev
  • 4,037
  • 20
  • 69
  • 129

2 Answers2

5

Both would work, simply because informational messages has a value of 3, while the maximum one that you want is 2.

However, if you wanted to log informational and error messages, but no debug messages, you'd have to set a value of array(1, 3) in order to skip the debug ones.

Narf
  • 14,600
  • 3
  • 37
  • 66
  • then why in comments says `array(2) = Debug Messages, without Error Messages` ? isn't this the same as `$config['log_threshold'] = 2;` ??? – ltdev Oct 20 '15 at 13:34
  • Because it's just impractical to repeat every previous line. – Narf Oct 20 '15 at 13:41
  • so either I set `$config['log_threshold'] = 2;`, either `$config['log_threshold'] = array(1, 2);` or `$config['log_threshold'] = array(2);`, all have the same result, right ? just to confirm .. – ltdev Oct 20 '15 at 13:47
0

In /application/config/config.php set $config['log_threshold'] = 1;

Sweta
  • 1