Skip to content

Commit

Permalink
Merge pull request #156 from aknosis/fix-scheduler-logs
Browse files Browse the repository at this point in the history
fixes logging of scheduled tasks
  • Loading branch information
mnapoli authored Jul 27, 2024
2 parents 1dd21c6 + 86046e8 commit 75035b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/BrefServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Bref\LaravelBridge\Queue\QueueHandler;

use Illuminate\Console\Events\ScheduledTaskStarting;

use Illuminate\Log\LogManager;

use Illuminate\Support\Facades\Config;
Expand Down Expand Up @@ -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'),
);
}
}

/**
Expand Down

0 comments on commit 75035b0

Please sign in to comment.