Luk*_*ell 1 php sentry laravel laravel-5 laravel-queue
我在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);
}
Run Code Online (Sandbox Code Playgroud)
在Laravel文档中检查如何处理失败的作业。