CodeIgniter 3 - 配置log_threshold

时间:2015-10-20 13:27:43

标签: php codeigniter codeigniter-3

好的我很困惑。

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);

有人可以给我一些澄清吗?

1 个答案:

答案 0 :(得分:3)

两者都可以,因为信息性消息的值为3,而您想要的最大值为2。

但是,如果您想记录信息和错误消息,但是没有调试消息,则必须设置值array(1, 3)才能跳过调试消息。< / p>