'log'=>array(
'class'=>'CLogRouter',
'routes'=> array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
),
),
设置日志路径和文件名
setLogPath($value)
getLogFile()
生成日志
$logFile = $this->getLogPath().DIRECTORY_SEPARATOR.$this->getLogFile();
//如果日志文件大于设置大小,根据设置日志文件数目重命名
$this->rotateFiles();
//根据自定义日志格式生成日志
@fwrite($fp,$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]));