我正在使用yii框架编写应用程序并使用yii logger功能。问题是它始终在日志文件的末尾附加调试日志语句。有没有人知道为什么会这样?
这是我的日志文件数据。
[info] [application] sending sms
[info] [application] exit _sendSms
[info] [application] first msg to business send . saving to database
[info] [application] entering _saveChat
[info] [application] exit _saveChat
[debug] [application] "incoming data value"
[debug] [application] "api used in _checkArrayFormat is exotel"
[debug] [application] " identifier is 123"
[debug] [application] " sms type is new"
[debug] [application] "api used in _setDataKey is exotel"
[debug] [application] " arrUniqueAplhaNum value is Array"
[debug] [application] "new UID created is g2f"
[debug] [application] "using api for outgoing sms exotel"
[debug] [application] "using api for outgoing sms exotel"
答案 0 :(得分:2)
您可以配置应记录日志路由的日志级别:
array(
'class' => 'CFileLogRoute',
'levels' => 'info,warning,error',
)
作为旁注:您在应用程序中调用debug
时似乎指定了日志级别Yii::log()
。它本身并不被禁止,但建议仅使用一组几个日志级别。请参阅here。
答案 1 :(得分:0)
您的日志级别配置应该如下所示!
array(
'class' => 'CFileLogRoute',
'levels'=>'warning,debug, info',
'logFile'=>'applicationbinary.log',
'maxFilesize'=>'1024',
),