52 public function handle(array $record)
54 if ($record[
'level'] < $this->level) {
58 if (!$this->initialized) {
60 register_shutdown_function(array($this,
'close'));
61 $this->initialized =
true;
64 if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) {
65 if ($this->flushOnOverflow) {
68 array_shift($this->buffer);
73 if ($this->processors) {
74 foreach ($this->processors as $processor) {
75 $record = call_user_func($processor, $record);
79 $this->buffer[] = $record;
87 if ($this->bufferSize === 0) {
91 $this->handler->handleBatch($this->buffer);
115 $this->bufferSize = 0;
116 $this->buffer = array();
126 $this->handler->reset();
An exception for terminatinating execution or to throw for unit testing.
Base Handler class providing the Handler structure.
Buffers all records until closing the handler and then pass them as batch.
__construct(HandlerInterface $handler, $bufferLimit=0, $level=Logger::DEBUG, $bubble=true, $flushOnOverflow=false)
clear()
Clears the buffer without flushing any messages down to the wrapped handler.
close()
{Closes the handler.This will be called automatically when the object is destroyed}
handle(array $record)
{Handles a record.All records may be passed to this method, and the handler should discard those that...
const DEBUG
Detailed debug information.
Interface that all Monolog Handlers must implement.
Handler or Processor implementing this interface will be reset when Logger::reset() is called.