daimakuai-ext / reporter
laravel 的异常报告工具
v1.0.0
2018-08-26 02:26 UTC
Requires
- php: >=7.0.0
- jblv/daimakuai: >=1.0.0
- laravel/framework: 5.5.*
Requires (Dev)
- laravel/laravel: 5.*
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2024-09-29 04:49:29 UTC
README
此工具将异常信息存储到数据库中,并提供一个开发友好的网络界面以查看异常信息。
截图
安装
$ 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) 下授权。
