diff --git a/src/BrefServiceProvider.php b/src/BrefServiceProvider.php index c88c51f..433acad 100644 --- a/src/BrefServiceProvider.php +++ b/src/BrefServiceProvider.php @@ -4,6 +4,8 @@ use Bref\LaravelBridge\Queue\QueueHandler; +use Illuminate\Console\Events\ScheduledTaskStarting; + use Illuminate\Log\LogManager; use Illuminate\Support\Facades\Config; @@ -103,6 +105,13 @@ public function boot(Dispatcher $dispatcher, LogManager $logManager, FailedJobPr $event->exception ) ); + + if (file_exists('/proc/1/fd/1')) { + $dispatcher->listen( + ScheduledTaskStarting::class, + fn(ScheduledTaskStarting $task) => $task->task->appendOutputTo('/proc/1/fd/1'), + ); + } } /**