소스 검색

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

Shreef 13 년 전
부모
커밋
96a2319a24
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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();
+        }
     }
 }