New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

rajinha92/rlogger

A log reporter for laravel
93
Install
composer require rajinha92/rlogger:dev-master
License:MIT
Last Updated:Aug 2, 2019
Links: GitHub  ·  Packagist
Maintainer: rajinha92

RLogger

What is RLogger?

RLogger is a simple package to save exceptions thrown by laravel applications and show them in a more readable form.

How to use it?

1- Dependency

You just need to require the composer package:

composer require rajinha92/rlogger
2 - ServiceProvider

Next you need to add the ServiceProvider in your config/app.php file.

config/app.php

    'providers' => [
        // ...
        \RLogger\Providers\RLoggerServiceProvider::class,
    ],
3 - Publishing files

Publish config and view files by typing in your terminal

php artisan vendor:publish

or

php artisan vendor:publish --provider="RLogger\Providers\RLoggerServiceProvider"
4 - Running migrations

This package has a migration file, that create the rlogger table, so you have to run the command:

php artisan migrate
5 - Error Handler

Last but not least, change your app\Exceptions\Handler.php

use RLogger\Traits\RLoggerReport;
...
use RLoggerReport;
...
//your report method should look like this
public function report(Exception $exception)
{
    $this->rlog($exception);
}

The rlog method will respect the shouldReport($exception) contained in the class.

6 - config

The rlogger route is under a basic authentication, so, you have to add the authorized users's id

return [
    'rlogger_authorized_user_id' => env('RLOGGER_AUTHORIZED_USER_ID', 1), //here goes the id, can be an array too
    'rlogger_laravel_report' => env('RLOGGER_LARAVEL_REPORT', false), //change to true if you want to automatically call parent::report($exception)
];
7 - Where are my logs?

Now all the exceptions will be available under the url /rlogger

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

660,512,042 9,702
laravel/framework

The Laravel Framework.

625,568,548 34,998
laravel/tinker

Powerful REPL for the Laravel framework.

531,591,559 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

450,320,528 608
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

424,642,029 4,662