SinkInterface
A destination for log events.
Each sink decides, per (level, category), whether it will accept an event, and how to render it.
Synopsis
Section titled “Synopsis”interface SinkInterface
| Implemented by | AbstractStreamSink |
| Source | Logging/Sink/SinkInterface.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
emit(LogEvent $event): void | Write the event to the destination. |
flush(): void | Flush any buffered output (end of request / worker reset). |
isEnabled(Level $level, string $category): bool | Whether this sink will emit an event at $level for $category. |
emit()
Section titled “emit()”abstract public function emit(LogEvent $event): void
Write the event to the destination.
Only called when isEnabled() is true.
| Parameter | Type | Description |
|---|---|---|
$event | LogEvent |
flush()
Section titled “flush()”abstract public function flush(): void
Flush any buffered output (end of request / worker reset).
isEnabled()
Section titled “isEnabled()”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()).
| Parameter | Type | Description |
|---|---|---|
$level | Level | |
$category | string |
Returns bool