daimakuai-ext/reporter

laravel 的异常报告工具

v1.0.0 2018-08-26 02:26 UTC

This package is not auto-updated.

Last update: 2024-09-29 04:49:29 UTC


README

此工具将异常信息存储到数据库中,并提供一个开发友好的网络界面以查看异常信息。

StyleCI Packagist Total Downloads Pull request welcome

截图

daimakuai-admin_exceptions

安装

$ composer require daimakuai-ext/reporter -vvv

$ php artisan vendor:publish --tag=daimakuai-admin-reporter

$ php artisan migrate --path=vendor/daimakuai-ext/reporter/database/migrations

$ php artisan admin:import reporter

打开 app/Exceptions/Handler.php 文件,在 report 方法中调用 Reporter::report()

<?php

namespace App\Exceptions;

use Jblv\Admin\Reporter\Reporter;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Validation\ValidationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
    ...

    public function report(Exception $exception)
    {
        if ($this->shouldReport($exception)) {
            Reporter::report($exception);
        }

//        parent::report($exception);
    }
    
    ...

}

打开 https:///admin/exceptions 来查看异常。

许可证

MIT 许可证 (MIT) 下授权。