rajinha92 / rlogger by rajinha92

A log reporter for laravel
93
0
1
Package Data
Maintainer Username: rajinha92
Maintainer Contact: rafael.conrado.farias@gmail.com (Rafael Conrado)
Package Create Date: 2017-07-29
Package Last Update: 2019-08-02
Language: PHP
License: MIT
Last Refreshed: 2025-02-06 03:06:37
Package Statistics
Total Downloads: 93
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

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