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