samdark/yii2-psr-log-target
Yii2 log target that forwards Yii log messages to any PSR-3 logger (e.g., Monolog). Configure PsrTarget in the log component, choose levels, and optionally add real event timestamps to the log context for accurate timing.
ILogger for scalability, observability, or third-party tooling.Log::channel()) be correlated or aggregated?Log::channel(), LogServiceProvider).Yii::debug(), Yii::error() calls).samdark/yii2-psr-log-target).Log::channel() with a custom driver to read from the shared transport.KafkaLogHandler or ElasticsearchLogHandler in Laravel.Yii::debug() → Yii::createObject([\yii\base\Logger::class, 'targets' => [new PsrLogTarget()]])).samdark/yii2-psr-log-target for Yii 2 compatibility.config/logging.php) to avoid Yii 2-specific overrides.tail -f storage/logs/laravel.log won’t show Yii 2 logs).Yii::trace()/Yii::error() spam to measure latency.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PSR-3 logger crashes (e.g., DB down) | Yii 2 logs lost or duplicated. | Fallback to Yii 2’s file-based logger. |
| Shared transport outage (e.g., Kafka) | Logs pile up in Yii 2’s buffer. | Local disk buffering with async replay. |
| Laravel log consumer fails | Yii 2 logs not visible in Laravel. | Alerting + dead-letter queue for failed logs. |
| Format incompatibility | Logs unreadable in Laravel. | Validate payloads early; use a schema validator. |
| Yii 2 upgrade breaks compatibility | Package stops working. | Pin Yii 2 version; test against minor updates. |
docker logs for containers, journalctl for systemd).{request_id} to all log contexts in both frameworks.How can I help you explore Laravel packages today?