Browse Source

Fixes #1500: Log messages exported to files are not separated by newlines

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
35df318e07
  1. 1
      framework/CHANGELOG.md
  2. 5
      framework/yii/log/FileTarget.php

1
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)

5
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}");
}

Loading…
Cancel
Save