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();
Base Handler class providing the Handler structure.
const DEBUG
Detailed debug information.
__construct(HandlerInterface $handler, $bufferLimit=0, $level=Logger::DEBUG, $bubble=true, $flushOnOverflow=false)
Handler or Processor implementing this interface will be reset when Logger::reset() is called...
Buffers all records until closing the handler and then pass them as batch.
handle(array $record)
{Handles a record.All records may be passed to this method, and the handler should discard those that...
Interface that all Monolog Handlers must implement.
clear()
Clears the buffer without flushing any messages down to the wrapped handler.