要配置main.php的DB配置加入
'enableProfiling'=>YII_DEBUG,
'enableParamLogging'=>YII_DEBUG,再将
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),改成以下代码
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
array(
'class'=>'CWebLogRoute',
'levels'=>'trace, info, error, warning, xdebug',
'categories' =>'system.db.*'
),
),
),
本文介绍如何在YII框架中配置日志记录,通过修改main.php文件中的DB配置实现详细的日志级别设置,包括错误、警告、跟踪及调试信息等,并指定了日志类别。
272

被折叠的 条评论
为什么被折叠?



