From f91929761a22c092ed14a0230c2188483720f13d Mon Sep 17 00:00:00 2001 From: Klimov Paul Date: Mon, 10 Nov 2014 14:53:15 +0200 Subject: [PATCH] `yii\log\Logger::flush()` updated to reset messages before passing them to the dispatcher. --- framework/log/Logger.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/log/Logger.php b/framework/log/Logger.php index 702ece9b9e1..90a02d24ef4 100644 --- a/framework/log/Logger.php +++ b/framework/log/Logger.php @@ -162,10 +162,11 @@ public function log($message, $level, $category = 'application') */ public function flush($final = false) { + $messages = $this->messages; + $this->messages = []; // prevent processing same message twice in case flush is invoked during dispatching if ($this->dispatcher instanceof Dispatcher) { - $this->dispatcher->dispatch($this->messages, $final); + $this->dispatcher->dispatch($messages, $final); } - $this->messages = []; } /**