Yii trace debug info setting

在main.php文件中,設置log

  'log' => array(
                    'class'  => 'CLogRouter' ,
                    'routes' => array(
                        array(
                            'class'  => 'CFileLogRoute' ,
                            'levels' => 'error, warning,trace,info'
                        ) ,
                        // the following to show log messages on web pages
                        array(
                            'class'   => 'CWebLogRoute' ,
                            'enabled' => YII_DEBUG  //如果
                        ) ,
                    )
                ),

If you don’t define YII_DEBUG, Yii will do it in YiiBase.php:

There’s a minor gotcha there since YII_DEBUG is always defined in yiibase like this

defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,false);

and this test, placed anywhere after the line in the index call to

Yii::createWebApplication($config)->run();

will always show YII_DEBUG as defined, no matter that it is defined by define(‘YII_DEBUG’,false);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章