Flow PHP

LogMiddleware

A chainable log-processing step inside a {@see Processor\PipelineLogProcessor}.

Unlike a LogProcessor (which terminates a pipeline by exporting), a middleware transforms or filters a single LogEntry and hands the result to the next step. It is stateless and has no lifecycle of its own - flush and shutdown belong to the pipeline's LogSink.

This mirrors the OpenTelemetry LogRecordProcessor model, where OnEmit receives a read/write record that a processor "may freely modify" and where filtering is an explicit responsibility. Because LogEntry is immutable, enrichment returns a new entry rather than mutating in place.

Methods

process()  : LogEntry|null
Transform or filter a log entry.

Methods

process()

Transform or filter a log entry.

public process(LogEntry $entry) : LogEntry|null

Return the entry to pass to the next step (the same instance, or a new one carrying enriched attributes), or null to drop it - dropping short-circuits the rest of the pipeline and the entry is never exported.

Parameters
$entry : LogEntry
Return values
LogEntry|null
On this page

Search results