Browse Source

little update related to issue #91 to make sure that the buffer won't get sent to the sub-handler twice

Shreef 13 năm trước cách đây
mục cha
commit
96a2319a24
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      src/Monolog/Handler/BufferHandler.php

+ 4 - 1
src/Monolog/Handler/BufferHandler.php

@@ -65,6 +65,9 @@ class BufferHandler extends AbstractHandler
      */
     public function close()
     {
-        $this->handler->handleBatch($this->buffer);
+        if($this->buffer) {
+            $this->handler->handleBatch($this->buffer);
+            $this->buffer = array();
+        }
     }
 }