Home > PHP Framework > Laravel > body text

Laravel Queue: How to view queue error information?

藏色散人
Release: 2019-10-23 23:01:08
forward
4849 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template