Flow PHP

LogSink extends LogProcessor

A terminal {@see LogProcessor} - the leaf/final step of a {@see Processor\PipelineLogProcessor}, which exports (or otherwise consumes) the entries that survive the middleware chain.

It is a marker over LogProcessor that adds no methods; its only purpose is to let a pipeline's sink slot be typed so a LogMiddleware - or a pipeline itself - cannot accidentally be wired there. The batching, pass-through, memory, void and composite processors are sinks.

Methods

flush()  : bool
Export all pending log records.
process()  : void
Process a log entry.
shutdown()  : void
Shutdown the processor.

Methods

flush()

Export all pending log records.

public flush() : bool

Forces immediate export of any buffered log records.

Return values
bool

True if all records were successfully exported

process()

Process a log entry.

public process(LogEntry $entry) : void

This is invoked synchronously when a log is emitted. The processor may buffer the entry, export it immediately, or discard it based on filtering rules.

Parameters
$entry : LogEntry

The complete log entry to process

shutdown()

Shutdown the processor.

public shutdown() : void

Implementations SHOULD flush() pending data before delegating shutdown to the underlying exporter. MUST be idempotent and MUST NOT throw.

On this page

Search results