mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fixes #1500: Log messages exported to files are not separated by newlines
This commit is contained in:
@ -83,10 +83,7 @@ class FileTarget extends Target
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
$text = '';
|
||||
foreach ($this->messages as $message) {
|
||||
$text .= $this->formatMessage($message);
|
||||
}
|
||||
$text = implode("\n", array_map([$this, 'formatMessage'], $this->messages)) . "\n";
|
||||
if (($fp = @fopen($this->logFile, 'a')) === false) {
|
||||
throw new InvalidConfigException("Unable to append to log file: {$this->logFile}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user