Code Monkey home page Code Monkey logo

reporter's Introduction

Exception reporter for laravel-admin

This tool stores the exception information into the database and provides a developer-friendly web interface to view the exception information.

StyleCI Packagist Total Downloads Pull request welcome

Screenshot

laravel-admin_exceptions

Installation

$ composer require laravel-admin-ext/reporter -vvv

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

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

$ php artisan admin:import reporter

Open app/Exceptions/Handler.php, call Reporter::report() inside report method:

<?php

namespace App\Exceptions;

use Encore\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);
    }
    
    ...

}

Open http://localhost/admin/exceptions to view exceptions.

License

Licensed under The MIT License (MIT).

reporter's People

Contributors

354651432 avatar frowhy avatar jxlwqq avatar z-song avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

reporter's Issues

laravel6.0

Dependency resolution completed in 0.052 seconds
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for laravel/framework (locked at v6.4.0, required as ^6.0) -> satisfiable by laravel/framework[v6.4.0].
- Conclusion: don't install laravel-admin-ext/reporter v1.0.1
- Can only install one of: encore/laravel-admin[1.5.x-dev, v1.7.7].
- Can only install one of: encore/laravel-admin[v1.7.7, 1.5.x-dev].
- Can only install one of: encore/laravel-admin[1.5.x-dev, v1.7.7].
- laravel-admin-ext/reporter v1.0.0 requires encore/laravel-admin 1.5.* -> satisfiable by encore/laravel-admin[1.5.x-dev].
- Installation request for laravel-admin-ext/reporter ^1.0 -> satisfiable by laravel-admin-ext/reporter[v1.0.0, v1.0.1].
- Installation request for encore/laravel-admin (locked at v1.7.7, required as ^1.7) -> satisfiable by encore/laravel-admin[v1.7.7].

Installation failed, reverting ./composer.json to its original content.

Impossible to delete more than 30 rows (50/100) at one time @ Exception Reporter (500 Internal Server Error)

@z-song hi!

Laravel admin 1.5.19

Reason is:
Data too long for column 'path' @ table admin_operation_log (at my DB field path is varchar(255))

As I can see possible workarounds:

  1. Bad: change at table schema varchar to text
  2. Better: truncate path variable
  3. The best: put ids from path to input attribute (send ids not as $_GET param, but as $_POST)

Full SQL error:

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'path' at row 1 
(SQL: insert into `admin_operation_log` (`user_id`, `path`, `method`, `ip`, `input`, `updated_at`, `created_at`) values 
(1, admin/exceptions/391,390,389,388,387,386,385,384,383,382,381,380,379,378,377,376,375,374,373,372,371,370,369,368,367,366,365,364,363,362,361,360,359,358,357,356,355,354,353,352,351,350,349,348,347,346,345,344,343,342,341,340,319,318,317,316,315,314,313,31, DELETE, 127.0.0.1, {"_method":"delete","_token":"MkNXt6V30KhIlPHfwSOt1Sxr1GLSeb9crLUoSmFu"}, 2019-03-05 17:40:22, 2019-03-05 17:40:22))

UPD: at my production DB path was VARCHAR(191), but when I changed its length to 255, than DELETE request for big number of rows started to work and just truncate row to 255 characters (path field).
path.admin_operation_log at DB for 100 entries looks like:
admin/exceptions/867,866,865,864,863,862,861,860,859,858,857,856,855,854,853,852,851,850,849,848,847,846,845,844,843,842,841,840,839,838,837,836,835,834,833,832,831,830,829,828,827,826,825,824,823,822,821,820,819,818,817,816,815,814,813,812,811,810,809,80

This much better, than just nothing. Dunno about such effects of varchar's length.

增加git关联

可不可以做成,report的时候记录git commit id,然后显示的堆栈文件用git里边的文件

Failed to install

$ ./composer.phar require laravel-admin-ext/reporter -vvv

Using version ^1.0 for laravel-admin-ext/reporter
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/framework (locked at v7.26.0, required as ^7.24) -> satisfiable by laravel/framework[v7.26.0].
    - Conclusion: don't install laravel-admin-ext/reporter v1.0.1
    - Can only install one of: encore/laravel-admin[1.5.x-dev, v1.8.2].
    - Can only install one of: encore/laravel-admin[v1.8.2, 1.5.x-dev].
    - Can only install one of: encore/laravel-admin[1.5.x-dev, v1.8.2].
    - laravel-admin-ext/reporter v1.0.0 requires encore/laravel-admin 1.5.* -> satisfiable by encore/laravel-admin[1.5.x-dev].
    - Installation request for laravel-admin-ext/reporter ^1.0 -> satisfiable by laravel-admin-ext/reporter[v1.0.0, v1.0.1].
    - Installation request for encore/laravel-admin (locked at v1.8.2, required as ^1.8) -> satisfiable by encore/laravel-admin[v1.8.2].


Installation failed, reverting ./composer.json to its original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.