\Monolog\HandlerFilterHandler

Simple handler wrapper that filters records based on a list of levels

It can be configured with an exact list of levels to allow, or a min/max level.

Summary

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

Properties

$level

$level : 

Type

$bubble

$bubble : Boolean

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

Type

Boolean

$processors

$processors : 

Type

$acceptedLevels

$acceptedLevels : array<mixed,integer>

Minimum level for logs that are passed to handler

Type

array<mixed,integer>

Methods

__construct()

__construct(callable|\Monolog\Handler\HandlerInterface  $handler, integer|array  $minLevelOrList = \Monolog\Logger::DEBUG, integer  $maxLevel = \Monolog\Logger::EMERGENCY, Boolean  $bubble = true) 

Parameters

callable|\Monolog\Handler\HandlerInterface $handler

Handler or factory callable($record, $this).

integer|array $minLevelOrList

A list of levels to accept or a minimum level if maxLevel is provided

integer $maxLevel

Maximum level to accept, only used if $minLevelOrList is not an array

Boolean $bubble

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

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.

Handlers should still check the record levels within handle(), returning false in isHandling() is no guarantee that handle() will not be called, and isHandling() might not be called for a given record.

Parameters

array $record

Partial log record containing only a level key

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) : self

Adds a processor in the stack.

Parameters

callable $callback

Returns

self

popProcessor()

popProcessor() : callable

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

Returns

callable

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.

__destruct()

__destruct() 

getAcceptedLevels()

getAcceptedLevels() : array

Returns

array

setAcceptedLevels()

setAcceptedLevels(integer|string|array  $minLevelOrList = \Monolog\Logger::DEBUG, integer|string  $maxLevel = \Monolog\Logger::EMERGENCY) 

Parameters

integer|string|array $minLevelOrList

A list of levels to accept or a minimum level or level name if maxLevel is provided

integer|string $maxLevel

Maximum level or level name to accept, only used if $minLevelOrList is not an array

handle()

handle(array  $record) 

{@inheritdoc}

Parameters

array $record