diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 22feb9e..ee38ade 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -6,6 +6,7 @@ Yii Framework 2 Change Log - Bug #1446: Logging while logs are processed causes infinite loop (qiangxue) - Bug #1497: Localized view files are not correctly returned (mintao) +- Bug #1500: Log messages exported to files are not separated by newlines (omnilight, qiangxue) - Bug #1509: The SQL for creating Postgres RBAC tables is incorrect (qiangxue) - Bug: Fixed `Call to a member function registerAssetFiles() on a non-object` in case of wrong `sourcePath` for an asset bundle (samdark) - Enh #1293: Replaced Console::showProgress() with a better approach. See Console::startProgress() for details (cebe) diff --git a/framework/yii/log/FileTarget.php b/framework/yii/log/FileTarget.php index 5aa4c12..4382aa5 100644 --- a/framework/yii/log/FileTarget.php +++ b/framework/yii/log/FileTarget.php @@ -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}"); }