Pradeep Jaiswar
Pradeep Jaiswar

Reputation: 1805

Yii Framework logger always attaches the debug log at end of file

I am using the yii framework to write a application and using yii logger functionality . The problem is it always append the debug log statement at the end of the log file. Does any one has idea how why this is happening ?

Here is my log file data.

 [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"

Upvotes: 0

Views: 178

Answers (2)

Pradeep Jaiswar
Pradeep Jaiswar

Reputation: 1805

Your log level config should be look like this !!

array(
                                    'class' => 'CFileLogRoute',
                    'levels'=>'warning,debug, info', 
                    'logFile'=>'applicationbinary.log',
                    'maxFilesize'=>'1024',
                ),

Upvotes: 0

Michael Härtl
Michael Härtl

Reputation: 8597

You can configure the log level that should be logged by a log route:

array(
    'class' => 'CFileLogRoute',
    'levels' => 'info,warning,error',
)

As a side note: You seem to specify the log level debug when you call Yii::log() in your application. It's not forbidden per se, but it's recommended to only use a set of a few log levels. See here.

Upvotes: 2

Related Questions