freemancontingent / laravellogflare by seamusdiamond

Checks logs on a schedule and emails alerts when errors are found. Stay ahead of your important applications to respond quickly to issues.
4,200
3
13
Package Data
Maintainer Username: seamusdiamond
Maintainer Contact: denisolvr@gmail.com (Denis Oliveira)
Package Create Date: 2016-10-19
Package Last Update: 2016-10-20
Language: PHP
License: MIT
Last Refreshed: 2024-04-25 15:05:52
Package Statistics
Total Downloads: 4,200
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 13
Total Forks: 0
Total Open Issues: 0

laravel-log-flare

Checks logs on a schedule and emails alerts when errors are found. Stay ahead of your important applications to respond quickly to issues.

License

Installation

You can install this package via Composer using:

composer require freemancontingent/laravellogflare

You must also install this service provider.

// config/app.php
'providers' => [
    ...
    Freemancontingent\Laravellogflare\FrllflareServiceProvider::class,
    ...
];

To publish the config file to app/config/logflare.php and the custom email template to resources/views/freemancontingent/logflare/email.blade.php run:

php artisan vendor:publish --provider="Freemancontingent\Laravellogflare\FrllflareServiceProvider"

This will publish a file app/config/logflare.php in your config directory with the following contents:

return [

    /*
    |--------------------------------------------------------------------------
    | Default Monolog Level check
    |--------------------------------------------------------------------------
    |
    | Here you may specify the default Monolog levels that should be used
    | by the Laravel Log Flare.
    |
    | Supported: debug, info, notice, warning, error, critical, alert, emergency
    |
    */

    'level' => ['error','critical'],

    /*
    |--------------------------------------------------------------------------
    | Support email address
    |--------------------------------------------------------------------------
    |
    | Email address to receive the report.
    |
    |
    */

    'support_email' => '',

    /*
    |--------------------------------------------------------------------------
    | Support email name
    |--------------------------------------------------------------------------
    |
    | Email name
    |
    |
    */

    'support_email_name' => '',

    /*
    |--------------------------------------------------------------------------
    | Email subject
    |--------------------------------------------------------------------------
    |
    | Flare email subject
    |
    */

    'subject' => '',

    /*
    |--------------------------------------------------------------------------
    | Log viewer link
    |--------------------------------------------------------------------------
    |
    | Add inside the email template the link to view all log.
    |
    |
    */

    'log_viewer_link' => '',

    /*
    |--------------------------------------------------------------------------
    | Print info logs
    |--------------------------------------------------------------------------
    |
    | Print info logs when the function is called.
    |
    | Supported: true,false
    |
    */

    'log' => true,

    /*
    |--------------------------------------------------------------------------
    | Use custom email template
    |--------------------------------------------------------------------------
    |
    | Use custom email template inside freemancontingent/logsflare/
    |
    | Supported: true, false
    |
    */

    'custom_email_template' => false,
];

Usage

After you've installed the package and filled in the values in the config-file working with this package will be a breeze. All the following examples use the facade. Don't forget to import it at the top of your schedule file app/Console/Kernel.php.

use Freemancontingent\Laravellogflare\Flare;
...
$schedule->call(function(){
            $flare = new Flare();
            $flare->firing();
         })->cron('00 07 * * *');
...         

Contributing

Please see CONTRIBUTING for details.

Credits

License

The Log Flare is open-sourced software licensed under the MIT license.