\Monolog\HandlerPsrHandler

Proxies log messages to an existing PSR-3 compliant logger.

If a formatter is configured, the formatter's output MUST be a string and the formatted message will be fed to the wrapped PSR logger instead of the original log record's message.

Summary

Methods
Properties
Constants
__construct()
isHandling()
setLevel()
getLevel()
setBubble()
getBubble()
reset()
handleBatch()
close()
__destruct()
__sleep()
handle()
setFormatter()
getFormatter()
No public properties found
No constants found
No protected methods found
$level
$bubble
$logger
$formatter
N/A
No private methods found
No private properties found
N/A

Properties

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$logger

$logger : \Psr\Log\LoggerInterface

PSR-3 compliant logger

Type

LoggerInterface

Methods

__construct()

__construct(\Psr\Log\LoggerInterface  $logger, mixed  $level = Logger::DEBUG, bool  $bubble = true) : mixed

Parameters

\Psr\Log\LoggerInterface $logger

The underlying PSR-3 compliant logger to which messages will be proxied

mixed $level

The minimum logging level at which this handler will be triggered

bool $bubble

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

Returns

mixed —

isHandling()

isHandling(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

setLevel()

setLevel(mixed  $level) : self

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

Parameters

mixed $level

Returns

self —

getLevel()

getLevel() : int

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

Returns

int —

setBubble()

setBubble(bool  $bubble) : self

Sets the bubbling behavior.

Parameters

bool $bubble

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

Returns

self —

getBubble()

getBubble() : bool

Gets the bubbling behavior.

Returns

bool —

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

reset()

reset() : void

handleBatch()

handleBatch(array  $records) : void

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

close()

close() : void

Closes the handler.

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

handle()

handle(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

setFormatter()

setFormatter(\Monolog\Formatter\FormatterInterface  $formatter) : \Monolog\Handler\HandlerInterface

Sets the formatter.

Parameters

\Monolog\Formatter\FormatterInterface $formatter

Returns

\Monolog\Handler\HandlerInterface —

self

getFormatter()

getFormatter() : \Monolog\Formatter\FormatterInterface

Gets the formatter.

Returns

\Monolog\Formatter\FormatterInterface —