Documentation

GroupHandler extends Handler
in package
implements ProcessableHandlerInterface, ResettableInterface uses ProcessableHandlerTrait

Forwards records to multiple handlers

Tags
author

Lenar Lõhmus lenar@city.ee

Table of Contents

Interfaces

ProcessableHandlerInterface
Interface to describe loggers that have processors
ResettableInterface
Handler or Processor implementing this interface will be reset when Logger::reset() is called.

Properties

$bubble  : bool
$handlers  : array<string|int, HandlerInterface>
$processors  : array<string|int, callable>

Methods

__construct()  : mixed
__destruct()  : mixed
__sleep()  : mixed
close()  : void
Closes the handler.
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
pushProcessor()  : HandlerInterface
reset()  : void
setFormatter()  : HandlerInterface
processRecord()  : LogRecord
resetProcessors()  : void

Properties

$processors

protected array<string|int, callable> $processors = []
Tags
phpstan-var

array<(callable(LogRecord): LogRecord)|ProcessorInterface>

Methods

__construct()

public __construct(array<string|int, HandlerInterface> $handlers[, bool $bubble = true ]) : mixed
Parameters
$handlers : array<string|int, HandlerInterface>

Array of Handlers.

$bubble : bool = true

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

Tags
throws
InvalidArgumentException

if an unsupported handler is set

__destruct()

public __destruct() : mixed

handle()

Handles a record.

public handle(LogRecord $record) : bool
Parameters
$record : LogRecord

The record to handle

Tags
inheritDoc
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

Tags
inheritDoc

isHandling()

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

public isHandling(LogRecord $record) : bool
Parameters
$record : LogRecord

Partial log record having only a level initialized

Tags
inheritDoc
Return values
bool
On this page

Search results