dqhr76378
2015-10-20 13:27
浏览 124
已采纳

CodeIgniter 3 - 配置log_threshold

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?

图片转代码服务由CSDN问答提供 功能建议

好的我很困惑。

application / config.php 里面,它在评论中说:

  | 如果已启用错误日志记录,则可以将错误阈值设置为
 | 确定记录的内容。 阈值选项是:
 | 您可以通过将阈值设置为零来启用错误记录。 成
 | 阈值确定记录的内容。 阈值选项为:
 | 
 |  0 =禁用日志记录,错误日志记录已关闭
 |  1 =错误消息(包括PHP错误)
 |  2 =调试消息
 |  3 =信息性消息
 |  4 =所有消息
 | 
 | 您还可以传递具有阈值级别的数组,以显示各个错误类型
 | 
 |  array(2)=调试消息,没有错误消息
   
 
 

因此,如果我想获取错误和调试消息而不是任何信息消息,我是否必须设置 阈值

  $ config ['log_threshold'] = 2; 
   
 
 

n

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

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

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanjuelian4640 2015-10-20 13:32
    已采纳

    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.

    打赏 评论

相关推荐 更多相似问题