首页 > 开发 > PHP > 正文

Yii调试查看执行SQL语句的方法

2024-05-04 22:00:55
字体:
来源:转载
供稿:网友

本文实例讲述了Yii调试查看执行SQL语句的方法,分享给大家供大家参考,具体如下,开户debug,修改配置文件 :protected/config/main.php,代码如下:

  1. 'log'=>array
  2.   'class'=>'CLogRouter'
  3.   'routes'=>array
  4.     array
  5.       'class'=>'CFileLogRoute'
  6.       'levels'=>'trace, info, error, warning'
  7.     ), //Vevb.com 
  8.     // uncomment the following to show log messages on web pages 
  9.     array
  10.       'class'=>'CWebLogRoute'
  11.       'levels'=>'trace',//级别为trace 
  12.       'categories'=>'system.db.*'//只显示关于数据库信息,包括数据库连接,数据库执行语句 
  13.     ), 
  14.   ), 
  15. ), 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表