【问题标题】:CodeIgniter 3 - configuring log_thresholdCodeIgniter 3 - 配置 log_threshold
【发布时间】:2015-10-20 13:27:43
【问题描述】:

好吧,我弄糊涂了。

application/config.php 里面用 cmets 写着:

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

谁能给我一些澄清?

【问题讨论】:

    标签: php codeigniter codeigniter-3


    【解决方案1】:

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

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

    【讨论】:

    • 那么为什么在 cmets 中说 array(2) = Debug Messages, without Error Messages ?这不是和$config['log_threshold'] = 2;一样吗???
    • 因为重复之前的每一行是不切实际的。
    • 所以我要么设置$config['log_threshold'] = 2;,要么设置$config['log_threshold'] = array(1, 2);,要么设置$config['log_threshold'] = array(2);,结果都一样,对吧?只是为了确认..
    猜你喜欢
    • 2016-01-05
    • 1970-01-01
    • 1970-01-01
    • 2017-11-23
    • 2011-07-14
    • 2020-06-27
    • 2015-06-02
    • 2012-06-08
    • 1970-01-01
    相关资源
    最近更新 更多