了解知识
Yii的参数配置里面可以设置调试信息(不仅包括SQL语句),在/yiiroot/protected/config/main.php中配置:
 
  1. 'log'=>array
  2.             'class'=>'CLogRouter'
  3.             'routes'=>array
  4.                 array
  5.                     'class'=>'CFileLogRoute'
  6.                     'levels'=>'error, warning'
  7.                 ), 
  8.                            ####################调试sql可开启################### 
  9.                             
  10.                                 array
  11.                                     'class' => 'CWebLogRoute'
  12.                                     'levels' => 'profile,trace'
  13.                                 ), 
  14.                                 array
  15.                                     'class' => 'CProfileLogRoute'
  16.                                     'levels' => 'profile'
  17.                                 ), 
  18.                 // uncomment the following to show log messages on web pages 
  19.                  
  20.                 array
  21.                     'class'=>'CWebLogRoute'
  22.                 ), 
  23.                 
  24.             ), 
  25.         ), 
标签: Yii框架 SQL
扩展知识