2015-10-20 86 views
0

好吧,我很困惑。CodeIgniter 3 - 配置log_threshold

裏面application/config.php它說在註釋:

| 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 

所以,如果我想要得到的錯誤和調試消息,並沒有任何信息的消息,我必須設置門檻

$config['log_threshold'] = 2; 

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

有人可以給我一些澄清?

回答

2

兩個會的工作,只是因爲參考消息具有值3,而您需要的最大一個是2

但是,如果你想信息和錯誤信息記錄,但沒有調試消息,您必須設置值array(1, 3)才能跳過調試。

+0

那麼爲什麼在評論中說'array(2)= Debug Messages,Without Error Messages'?與$ config ['log_threshold'] = 2不同;'??? – Lykos

+0

因爲重複之前的每一行是不切實際的。 – Narf

+0

因此,無論我設置'$ config ['log_threshold'] = 2;',或者$ config ['log_threshold'] = array(1,2);'或$ config ['log_threshold'] = array(2) ;',都有相同的結果,對吧?只是爲了確認.. – Lykos