\Monolog\HandlerBufferHandler

Buffers all records until closing the handler and then pass them as batch.

This is useful for a MailHandler to send only one mail per request instead of sending one per log message.

Summary

Methods
Properties
Constants
pushProcessor()
popProcessor()
__construct()
isHandling()
setLevel()
getLevel()
setBubble()
getBubble()
reset()
handleBatch()
close()
__destruct()
__sleep()
handle()
flush()
clear()
setFormatter()
getFormatter()
No public properties found
No constants found
processRecord()
resetProcessors()
$processors
$level
$bubble
$handler
$bufferSize
$bufferLimit
$flushOnOverflow
$buffer
$initialized
N/A
No private methods found
No private properties found
N/A

Properties

$processors

$processors : array<mixed,callable>

Type

array<mixed,callable>

$level

$level : 

Type

$bubble

$bubble : 

Type

$bufferSize

$bufferSize : 

Type

$bufferLimit

$bufferLimit : 

Type

$flushOnOverflow

$flushOnOverflow : 

Type

$buffer

$buffer : 

Type

$initialized

$initialized : 

Type

Methods

pushProcessor()

pushProcessor(callable  $callback) 

{@inheritdoc}

Parameters

callable $callback

popProcessor()

popProcessor() 

{@inheritdoc}

__construct()

__construct(\Monolog\Handler\HandlerInterface  $handler, integer  $bufferLimit, string|integer  $level = \Monolog\Logger::DEBUG, boolean  $bubble = true, boolean  $flushOnOverflow = false) 

Parameters

\Monolog\Handler\HandlerInterface $handler

Handler.

integer $bufferLimit

How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.

string|integer $level

The minimum logging level at which this handler will be triggered

boolean $bubble

Whether the messages that are handled can bubble up the stack or not

boolean $flushOnOverflow

If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded

isHandling()

isHandling(array  $record) 

{@inheritdoc}

Parameters

array $record

setLevel()

setLevel(integer|string  $level) : self

Sets minimum logging level at which this handler will be triggered.

Parameters

integer|string $level

Level or level name

Returns

self

getLevel()

getLevel() : integer

Gets minimum logging level at which this handler will be triggered.

Returns

integer

setBubble()

setBubble(boolean  $bubble) : self

Sets the bubbling behavior.

Parameters

boolean $bubble

true means that this handler allows bubbling. false means that bubbling is not permitted.

Returns

self

getBubble()

getBubble() : boolean

Gets the bubbling behavior.

Returns

boolean —

true means that this handler allows bubbling. false means that bubbling is not permitted.

reset()

reset() : void

handleBatch()

handleBatch(array  $records) 

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

close()

close() 

{@inheritdoc}

__destruct()

__destruct() 

__sleep()

__sleep() 

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

flush()

flush() 

clear()

clear() 

Clears the buffer without flushing any messages down to the wrapped handler.

processRecord()

processRecord(array  $record) 

Processes a record.

Parameters

array $record

resetProcessors()

resetProcessors()