Home >PHP Framework >Laravel >Laravel Queue: How to view queue error information?

Laravel Queue: How to view queue error information?

藏色散人
藏色散人forward
2019-09-23 09:28:114885browse

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:

Laravel Queue: How to view queue error information?

##Method 3, Laravel Horizon

Officially maintained Laravel Horizon is a Redis queue view management tool that can very intuitively see your queue execution:

Laravel Queue: How to view queue error information?

View failed queues:

Laravel Queue: How to view queue error information?

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!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete