CodeIgniter 3 -配置日志阈值

bakd9h0s  于 2022-12-07  发布在  其他
关注(0)|答案(2)|浏览(169)

好吧我搞糊涂了。
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);

有人能给予我澄清一下吗?

ibrsph3r

ibrsph3r1#

这两种方法都有效,因为信息性消息的值为3,而您需要的最大值为2。
但是,如果您希望记录信息性消息和错误消息,而 no 调试消息,则必须设置array(1, 3)值以跳过调试消息。

cqoc49vn

cqoc49vn2#

在/application/config/config. php中设置$config ['日志阈值']= 1;

相关问题