drinks-it/sf-consumer-logger-bundle
php artisan queue:work) if the logging logic is decoupled from Symfony-specific components.Log::info()) and queue worker hooks (e.g., Illuminate\Queue\Events\JobProcessed)..env or config/services.php with minimal effort.Psr\Log\LoggerInterface). Laravel’s logging system is PSR-compliant, so this is a non-blocker but requires abstraction.ConsumerStartedEvent). Laravel uses JobProcessed or custom events.Psr\Log) aligns with the target setup.queue:work lacks built-in lifecycle events. Would custom event listeners suffice, or is a full rewrite needed?Illuminate\Queue\Events\JobProcessing and JobProcessed to mirror on_start/on_stop.ConsumerAwareInterface in RabbitMQ PHP client).Log::debug('Worker started')).on_running state for long-running jobs).// app/Providers/QueueServiceProvider.php
public function boot()
{
Queue::before(function ($event) {
Log::info(config('sf_consumer_logger.on_start_message'));
});
}
config/services.php:
'sf_consumer_logger' => [
'on_start' => env('CONSUMER_LOG_LEVEL', 'info'),
'on_start_message' => 'Consumer started',
// ...
],
single, stack, or syslog).symfony/messenger). Mitigate by using composer’s replace or a custom wrapper.config/services.php aligns with Laravel’s conventions, reducing drift.spatie/laravel-queue-logger).Log::async() in Laravel).rotating_files) to manage storage costs for consumer logs.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Worker crashes silently | No on_stop log; hard to debug |
Use Laravel’s queue:failed table + alerts. |
| Logging backend fails | Lost lifecycle events | Fallback to error_log() or dead-letter queue. |
| Config misalignment | Incorrect log levels/messages | Validate config in bootstrap/app.php. |
| Symfony dependency conflicts | Composer install failures | Use composer why-not or replace directives. |
on_start appears before job processing).JobProcessed instead of ConsumerStoppedEvent").How can I help you explore Laravel packages today?