我在 Laravel 项目上设置了 Sentry.io。我也在使用队列。
我想知道是否可以将失败的队列发送到 Sentry?因为它们在失败时不会自动发送。
最佳答案
失败的队列我猜你的意思是失败的作业,为此你只需要实现 failed()
作业内的方法:
/**
* Handle a job failure.
*
* @return void
*/
public function failed(\Exception $exception)
{
// Send exception data to sentry.io
// It should catch it by default since it throws an exception
// But you can force a report manually
app('sentry')->captureException($exception);
}
查看如何处理失败的作业 Laravel documentation .
关于php - 向 Laravel 队列中的 Sentry 发送错误报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49509750/