mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-06 08:14:21 +01:00
Better CFileLogRoute performance
This commit is contained in:
@@ -140,8 +140,10 @@ class CFileLogRoute extends CLogRoute
|
||||
@flock($fp,LOCK_EX);
|
||||
if(@filesize($logFile)>$this->getMaxFileSize()*1024)
|
||||
$this->rotateFiles();
|
||||
$buffer='';
|
||||
foreach($logs as $log)
|
||||
@fwrite($fp,$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]));
|
||||
$buffer.=$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]);
|
||||
@fwrite($fp,$buffer);
|
||||
@flock($fp,LOCK_UN);
|
||||
@fclose($fp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user