Skip to content

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

License

Notifications You must be signed in to change notification settings

freemancontingent/laravel-log-flare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published