LaravelPackages.net
Acme Inc.
Toggle sidebar
henrotaym/laravel-flare-exception-handler

Simple exception handler logging exception context to flare.

7.217
0
v4.0.1
About henrotaym/laravel-flare-exception-handler

henrotaym/laravel-flare-exception-handler is a Laravel package for simple exception handler logging exception context to flare.. It currently has 0 GitHub stars and 7.217 downloads on Packagist (latest version v4.0.1). Install it with composer require henrotaym/laravel-flare-exception-handler. Discover more Laravel packages by henrotaym or browse all Laravel packages to compare alternatives.

Last updated

Flare exception handler

Compatibility

| Version de laravel | Version du package | |--|--| | 7.x.x | 1.x.x | | 8.x.x | 2.x.x | | 9.x.x | 2.x.x | | 10.x.x | 3.x.x | | 11.x.x | 3.x.x | | 12.x.x | 4.x.x |

Installation

composer require henrotaym/laravel-flare-exception-handler

Configuration

Environment

LOG_CHANNEL=flare

Usage

Optimal

namespace App\Exceptions;

use Henrotaym\LaravelFlareExceptionHandler\Context\FlareContext;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
    public function register()
    {
        // Add this line to report context to flare
        $this->reportable(FlareContext::report());
    }
}

Deprecated

Your application Handler.php should look like this

namespace App\Exceptions;

use Henrotaym\LaravelFlareExceptionHandler\FlareExceptionHandler;

class Handler extends FlareExceptionHandler
{
    
}

If you need more control, override register method from handler and call this method where needed :

    /**
    * Reporting exception context to flare.
    * 
    * @param Throwable $e
    * @return void
    */
    protected function reportContextToFlare(Throwable $e);
Comments