Skip to content

TextStreamSink

Human-readable single-line sink for local development.

Writes to any stream (stderr by default). Not intended for structured log aggregation — use JsonStdoutSink in containers. 2026-07-01T08:02:55.123Z WARNING Quiote.Routing: no route matched /foo {rid=abc}

class TextStreamSink extends AbstractStreamSink

ExtendsAbstractStreamSink
SourceLogging/Sink/TextStreamSink.php

public function __construct(string $stream = 'php://stderr', Level $minLevel = Quiote\Logging\Level::Debug, array<string, Level> $categoryOverrides = [], resource|null $streamResource = null): mixed

An already-open writable resource (e.g. for tests), used instead of opening $stream lazily.

ParameterTypeDescription
$streamstringA stream path (opened lazily, append).
$minLevelLevelMinimum level this sink accepts by default.
$categoryOverridesarray``<``string``, Level>category-prefix => min level.
$streamResource`resource““null`

Returns mixed

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
emit()AbstractStreamSinkRenders the event through the subclass TextStreamSink::format() and writes it as one newline-terminated line.
flush()AbstractStreamSinkFlushes the underlying stream if one has been opened.
isEnabled()AbstractStreamSinkWhether this sink accepts an event at $level for $category.