Yii trace debug info setting

2019-05-08  本文已影响0人  lookphp

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

上一篇 下一篇

猜你喜欢

热点阅读