'db'=>array( ... ... /* * 下面是调试信息,显示执行的数据库操作 */ 'enableProfiling'=>YII_DEBUG, 'enableParamLogging'=>YII_DEBUG, ), ... ... 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'CFileLogRoute', 'levels'=>'trace, info', 'categories'=>'system.*', ), array( 'class'=>'CEmailLogRoute', 'levels'=>'error, warning', 'emails'=>'admin@example.com', ), ), ),
<?php // remove the following lines when in production mode defined('YII_DEBUG') or define('YII_DEBUG',true); // specify how many levels of call stack should be shown in each log message defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',9);//3
Yii::log($message, $level, $category); Yii::trace($message, $category);
原文地址:http://blog.csdn.net/liuruiqun/article/details/45600867