Flow PHP

MemoryLogProcessor implements LogProcessor

FinalYes

Processor that stores log entries in memory and exports via configured exporter.

Interfaces

LogProcessor
Interface for processing log records.

Methods

__construct()  : mixed
countLogs()  : int
Get the total number of recorded log entries.
entries()  : array<string|int, LogEntry>
Get all recorded log entries.
entriesContaining()  : array<string|int, LogEntry>
Filter log entries by body substring.
entriesWithSeverity()  : array<string|int, LogEntry>
Filter log entries by severity.
exporter()  : LogExporter
Get the exporter used by this processor.
flush()  : bool
Export all pending log records.
process()  : void
Process a log entry.
reset()  : void
Reset all stored data.

Methods

countLogs()

Get the total number of recorded log entries.

public countLogs() : int
Return values
int

entriesContaining()

Filter log entries by body substring.

public entriesContaining(string $substring) : array<string|int, LogEntry>
Parameters
$substring : string
Return values
array<string|int, LogEntry>

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


        
On this page

Search results