Skip to content

SinkInterface

A destination for log events.

Each sink decides, per (level, category), whether it will accept an event, and how to render it.

interface SinkInterface

Implemented byAbstractStreamSink
SourceLogging/Sink/SinkInterface.php
MethodDescription
emit(LogEvent $event): voidWrite the event to the destination.
flush(): voidFlush any buffered output (end of request / worker reset).
isEnabled(Level $level, string $category): boolWhether this sink will emit an event at $level for $category.

abstract public function emit(LogEvent $event): void

Write the event to the destination.

Only called when isEnabled() is true.

ParameterTypeDescription
$eventLogEvent

abstract public function flush(): void

Flush any buffered output (end of request / worker reset).

abstract public function isEnabled(Level $level, string $category): bool

Whether this sink will emit an event at $level for $category.

Kept cheap (called on the hot path via CategoryLogger::isEnabled()).

ParameterTypeDescription
$levelLevel
$categorystring

Returns bool