Flow PHP

LogRecordConverter

Read onlyYes
FinalYes

Convert a PSR-3 log call (level + message + context) into a Telemetry LogRecord.

Behavior:

  • Severity mapped via SeverityMapper.
  • Message body has {placeholder} tokens substituted from context per PSR-3 §1.2. Only scalars and Stringable objects participate in interpolation; arrays, Throwables, and objects without __toString are left in the template.
  • Every context entry is recorded as an attribute under its raw key.
  • A Throwable under the exception key is routed through LogRecord::setException() (populates exception.type/message/stacktrace) and NOT also recorded under the exception attribute.

Methods

__construct()  : mixed
convert()  : LogRecord

Methods

convert()

public convert(string|Stringable $level, string|Stringable $message[, array<string|int, mixed> $context = [] ]) : LogRecord
Parameters
$level : string|Stringable
$message : string|Stringable
$context : array<string|int, mixed> = []
Return values
LogRecord

        
On this page

Search results