diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index e0e16da3f4..55f26fc717 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -9,8 +9,9 @@ Yii Framework 2 Change Log - Enh #17345: Improved performance of `yii\db\Connection::quoteColumnName()` (brandonkelly) - Enh #17348: Improved performance of `yii\db\Connection::quoteTableName()` (brandonkelly) - Enh #17353: Added `sameSite` support for `yii\web\Cookie` and `yii\web\Session::cookieParams` (rhertogh) -- Bug #17341: Allow callable objects to be set to `\yii\filters\AccessRule::$roleParams` (alexkart) -- Bug #17070: Strip invalid character from fallback file name (alexkart) +- Bug #17341: Allowed callable objects to be set to `\yii\filters\AccessRule::$roleParams` (alexkart) +- Bug #17070: Striped invalid character from fallback file name in `Content-Disposition` header when using `\yii\web\Response::sendFile` (alexkart) +- Bug #16565: Added missing parts of the context message in `\yii\log\Target::collect` (alexkart) 2.0.20 June 04, 2019 diff --git a/framework/log/Target.php b/framework/log/Target.php index c15af179c9..2a192e80d5 100644 --- a/framework/log/Target.php +++ b/framework/log/Target.php @@ -150,7 +150,7 @@ abstract class Target extends Component $count = count($this->messages); if ($count > 0 && ($final || $this->exportInterval > 0 && $count >= $this->exportInterval)) { if (($context = $this->getContextMessage()) !== '') { - $this->messages[] = [$context, Logger::LEVEL_INFO, 'application', YII_BEGIN_TIME]; + $this->messages[] = [$context, Logger::LEVEL_INFO, 'application', YII_BEGIN_TIME, [], 0]; } // set exportInterval to 0 to avoid triggering export again while exporting $oldExportInterval = $this->exportInterval; diff --git a/tests/framework/log/TargetTest.php b/tests/framework/log/TargetTest.php index b055da6729..22db667f0a 100644 --- a/tests/framework/log/TargetTest.php +++ b/tests/framework/log/TargetTest.php @@ -220,6 +220,22 @@ class TargetTest extends TestCase $formatted = $target->formatMessage([$text, $level, $category, $timestamp]); $this->assertSame($expectedWithMicro, $formatted); } + + public function testCollectMessageStructure() + { + $target = new TestTarget(['logVars' => ['_SERVER']]); + static::$messages = []; + + $messages = [ + ['test', 1, 'application', 1560428356.212978, [], 1888416] + ]; + + $target->collect($messages, false); + + $this->assertCount(2, static::$messages); + $this->assertCount(6, static::$messages[0]); + $this->assertCount(6, static::$messages[1]); + } } class TestTarget extends Target