Question
When Laravel queue is executed, it is like a black box. How should we debug when an error occurs?
Method 1, sync driver
If you are in a development environment, modify .env:
QUEUE_DRIVER=sync
So that you can view the trigger point directly through the Web request to the error message.
Method 2, failed-table
Laravel comes with a failed_jobs data table to record all error queues, which needs to be initialized using the following command:
$ php artisan queue:failed-table $ php artisan migrate
After an error occurs, you can see the error message in the database. Pay attention to the exception field:
##Method 3, Laravel Horizon
Officially maintained Laravel Horizon is a Redis queue view management tool that can very intuitively see your queue execution: View failed queues:For more Laravel related technical articles, please visit the
Laravel Framework Getting Started Tutorial column to learn!
The above is the detailed content of Laravel Queue: How to view queue error information?. For more information, please follow other related articles on the PHP Chinese website!