Yii查看执行的SQL

开户debug

修改配置文件 :protected/config/main.php,

'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'trace, info, error, warning',
                ),
                // uncomment the following to show log messages on web pages
                array(
                    'class' => 'CWebLogRoute',
                    'levels' => 'trace', //级别为trace
                    'categories' => 'system.db.*' //只显示关于数据库信息,包括数据库连接,数据库执行语句
                ),
            ),
        ),

posted @ 2015-06-03 15:15  brady-wang  阅读(848)  评论(0编辑  收藏  举报