Documentation

HandlerWrapper
in package
implements HandlerInterface, ProcessableHandlerInterface, FormattableHandlerInterface, ResettableInterface

This simple wrapper class can be used to extend handlers functionality.

Example: A custom filtering that can be applied to any handler.

Inherit from this class and override handle() like this:

public function handle(array $record) { if ($record meets certain conditions) { return false; } return $this->handler->handle($record); }

Tags
author

Alexey Karapetov alexey@karapetov.com

Interfaces, Classes and Traits

HandlerInterface
Interface that all Monolog Handlers must implement
ProcessableHandlerInterface
Interface to describe loggers that have processors
FormattableHandlerInterface
Interface to describe loggers that have a formatter
ResettableInterface
Handler or Processor implementing this interface will be reset when Logger::reset() is called.

Table of Contents

$handler  : HandlerInterface
__construct()  : mixed
close()  : void
Closes the handler.
getFormatter()  : FormatterInterface
Gets the formatter.
handle()  : bool
Handles a record.
handleBatch()  : void
Handles a set of records at once.
isHandling()  : bool
Checks whether the given record will be handled by this handler.
popProcessor()  : callable|ProcessorInterface
Removes the processor on top of the stack and returns it.
pushProcessor()  : HandlerInterface
Adds a processor in the stack.
reset()  : void
setFormatter()  : HandlerInterface
Sets the formatter.

Properties

Methods

close()

Closes the handler.

public close() : void
Return values
void

handle()

Handles a record.

public handle(array<string|int, mixed> $record) : bool
Parameters
$record : array<string|int, mixed>

The record to handle

Return values
bool

true means that this handler handled the record, and that bubbling is not permitted. false means the record was either not processed or that this handler allows bubbling.

handleBatch()

Handles a set of records at once.

public handleBatch(array<string|int, mixed> $records) : void
Parameters
$records : array<string|int, mixed>

The records to handle (an array of record arrays)

Return values
void

isHandling()

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

public isHandling(array<string|int, mixed> $record) : bool
Parameters
$record : array<string|int, mixed>

Partial log record containing only a level key

Return values
bool

Search results