YII第三步,日志开启
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"); }