Laravel DontReport在处理程序中不起作用

时间:2018-12-07 08:41:00

标签: laravel laravel-5 exception-handling laravel-5.2

处理程序文件中的Laravel dontReport无法正常工作,遵循dontReport的代码

protected $dontReport = [
    Illuminate\Auth\AuthenticationException::class,
    Illuminate\Auth\Access\AuthorizationException::class,
    Symfony\Component\HttpKernel\Exception\HttpException::class,
    Illuminate\Database\Eloquent\ModelNotFoundException::class,
    Illuminate\Session\TokenMismatchException::class,
    Illuminate\Validation\ValidationException::class,
    Illuminate\View\View::class,
    Illuminate\Routing\RouteCollection::class,
    Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class,
    Illuminate\Session\Middleware\StartSession::class,
];

1 个答案:

答案 0 :(得分:0)

尝试在您的report方法中添加以下代码:

if($this->shouldReport($exception) {
    // Send email
}

您还可以考虑检查您的环境以及在相同的if语句中是否存在异常消息。