CodeIgniter 3 - configuring log_threshold

不羁岁月 提交于 2020-01-07 03:05:02

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/33237977/codeigniter-3-configuring-log-threshold

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!