index.php入口文件配置;
defined(‘YII_DEBUG‘) or define(‘YII_DEBUG‘,true);
cofig/main.php
‘preload‘=>array(‘log‘), ‘log‘=>array( ‘class‘=>‘CLogRouter‘, ‘routes‘=>array( array( ‘class‘=>‘CFileLogRoute‘, ‘levels‘=>‘info,error,warning‘, ), ), ),
示例代码 siteController.php
public function actionIndex()
{
Yii::trace(‘action‘, ‘site.action‘); Yii::log("action","info","site.action"); }
时间: 2024-10-14 13:08:10