gpt4 book ai didi

php - 在 Yii 中调试 SQL 查询。 CFileLogRoute 与 CWebLogRoute

转载 作者:搜寻专家 更新时间:2023-10-31 20:47:00 24 4
gpt4 key购买 nike

网上查了很多,还是没搞明白。 CWebLogRoute 不显示 SQL 调试信息,但 CFileLogRoute 显示。关于如何让 CWebLogRoute 工作的任何想法?谢谢!

这是我的配置文件:

'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=myname',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'enableParamLogging'=>true,
'enableProfiling'=>true,
),

'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning, trace, info',
),
array(
'class'=>'CWebLogRoute',
'levels'=>'error, warning, trace, info',
),
)

最佳答案

它至少显示了一些东西吗?它在我的本地工作正常。尝试将 profile 添加到 CWebLogRoute.levels 中。顺便说一句,对于 sql,我更喜欢 CProfileLogRoute:

array(
'class'=>'CProfileLogRoute',
'enabled'=> YII_DEBUG,
),

关于php - 在 Yii 中调试 SQL 查询。 CFileLogRoute 与 CWebLogRoute,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12022484/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com