\Monolog\HandlerFingersCrossedHandler

Buffers all records until a certain level is reached

The advantage of this approach is that you don't get any clutter in your log files. Only requests which actually trigger an error (or whatever your actionLevel is) will be in the logs, but they will contain all records, not only those above the level threshold.

Summary

Methods
Properties
Constants
__construct()
isHandling()
handleBatch()
close()
pushProcessor()
popProcessor()
setFormatter()
getFormatter()
setLevel()
getLevel()
setBubble()
getBubble()
__destruct()
handle()
reset()
No public properties found
No constants found
getDefaultFormatter()
$level
$bubble
$formatter
$processors
$handler
$actionLevel
$buffering
$bufferSize
$buffer
$stopBuffering
N/A
No private methods found
No private properties found
N/A

Properties

$level

$level : 

Type

$bubble

$bubble : 

Type

$processors

$processors : 

Type

$handler

$handler : 

Type

$actionLevel

$actionLevel : 

Type

$buffering

$buffering : 

Type

$bufferSize

$bufferSize : 

Type

$buffer

$buffer : 

Type

$stopBuffering

$stopBuffering : 

Type

Methods

__construct()

__construct(callback|\Monolog\Handler\HandlerInterface  $handler, integer  $actionLevel = \Monolog\Logger::WARNING, integer  $bufferSize, Boolean  $bubble = true, Boolean  $stopBuffering = true) 

Parameters

callback|\Monolog\Handler\HandlerInterface $handler

Handler or factory callback($record, $fingersCrossedHandler).

integer $actionLevel

The minimum logging level at which this handler will be triggered

integer $bufferSize

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

Boolean $bubble

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

Boolean $stopBuffering

Whether the handler should stop buffering after being triggered (default true)

isHandling()

isHandling(array  $record) : Boolean

Checks whether the given record will be handled by this handler.

This is mostly done for performance reasons, to avoid calling processors for nothing.

Parameters

array $record

Returns

Boolean

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() 

Closes the handler.

This will be called automatically when the object is destroyed

pushProcessor()

pushProcessor(callable  $callback) 

Adds a processor in the stack.

Parameters

callable $callback

popProcessor()

popProcessor() : callable

Removes the processor on top of the stack and returns it.

Returns

callable

setLevel()

setLevel(integer  $level) 

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

Parameters

integer $level

getLevel()

getLevel() : integer

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

Returns

integer

setBubble()

setBubble(Boolean  $bubble) 

Sets the bubbling behavior.

Parameters

Boolean $bubble

True means that bubbling is not permitted. False means that this handler allows bubbling.

getBubble()

getBubble() : Boolean

Gets the bubbling behavior.

Returns

Boolean —

True means that bubbling is not permitted. False means that this handler allows bubbling.

__destruct()

__destruct() 

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record

reset()

reset() 

Resets the state of the handler. Stops forwarding records to the wrapped handler.