1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-24 15:02:28 +01:00

Merge pull request #93 from Shreef/master

2nd fix for issue #91
This commit is contained in:
Jordi Boggiano 2012-06-14 06:40:10 -07:00
commit afa7d891cc

View File

@ -38,6 +38,9 @@ class BufferHandler extends AbstractHandler
parent::__construct($level, $bubble); parent::__construct($level, $bubble);
$this->handler = $handler; $this->handler = $handler;
$this->bufferSize = $bufferSize; $this->bufferSize = $bufferSize;
// __destructor() doesn't get called on Fatal errors
register_shutdown_function(array($this, 'close'));
} }
/** /**
@ -62,6 +65,9 @@ class BufferHandler extends AbstractHandler
*/ */
public function close() public function close()
{ {
$this->handler->handleBatch($this->buffer); if($this->buffer) {
$this->handler->handleBatch($this->buffer);
$this->buffer = array();
}
} }
} }