質問

In my index.php file ,

I know that this YII_DEBUG is use to show any error on browser screen

defined('YII_DEBUG') or define('YII_DEBUG',true);

What is mean this below line YII_TRACE_LEVEL ?

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

1)What is YII_TRACE_LEVEL?

2)What is 3 meaning in this?

役に立ちましたか?

解決

Yes,you are right. The define('YII_DEBUG',true) display exception on you browser screen .

The Log for same is also create in protected/runtime/*.log

The YII_TRACE_LEVEL number determines how many layers of each error or stack should be recorded in your trace messages i.e. how long log you want to see.

You can read more about it click here

他のヒント

Yii can log call stack information. This is disabled by default due to performance considerations .

To enable this feature YII_TRACE_LEVEL is defined (allowed int > 0) in index.php

The number of YII_TRACE_LEVEL determines how many layers of each call stack should be recorded in your trace messages

See http://www.yiiframework.com/doc/guide/1.1/en/topics.logging#logging-context-information

1) What is YII_TRACE_LEVEL?
<< Specify how many levels of call stack should be shown in each log message

2) What is 3 meaning in this?
<< It acts like a max iteration allowed value in the logs function.
<< Checking how is used you can have a clearer idea:

public static function log($msg,$level=CLogger::LEVEL_INFO,$category='application')
{
    if(YII_DEBUG && YII_TRACE_LEVEL>0 && $level!==CLogger::LEVEL_PROFILE)
    {
        // ...
        $traces=debug_backtrace();
        $count=0;
        foreach($traces as $trace)
        {
            // ...
            if(++$count>=YII_TRACE_LEVEL) // used to break loop
                break;
        }
    }       
}

ref: https://github.com/yiisoft/yii/blob/1.1.15/framework/YiiBase.php#L464

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top