LaravelPackages.net
Acme Inc.
Toggle sidebar
timetorock/laravel-monolog-sentry

Laravel 5.x.x library for integration Monolog Sentry

2.131
2
v1.6
About timetorock/laravel-monolog-sentry

timetorock/laravel-monolog-sentry is a Laravel package for laravel 5.x.x library for integration monolog sentry. It currently has 2 GitHub stars and 2.131 downloads on Packagist (latest version v1.6). Install it with composer require timetorock/laravel-monolog-sentry. Discover more Laravel packages by timetorock or browse all Laravel packages to compare alternatives.

Last updated

Monolog Sentry for Laravel 5.x

Software License

Laravel 5.x library for integration Monolog errors with Sentry sentry-laravel.

This library implies already installed sentry-laravel.

Installation

Go to the root of your Laravel project and run the following command:

Laravel 5.4 or earlier:

composer require timetorock/laravel-monolog-sentry 1.3

Laravel 5.5+:

composer require timetorock/laravel-monolog-sentry

Laravel 5.4 or earlier

(Service will be auto-discovered by Laravel 5.5+)

Then in your config/app.php add the MonologSentryServiceProvider to your providers array

'providers' => array(

    ...
    Timetorock\LaravelMonologSentry\Providers\MonologSentryServiceProvider::class,
),

Configuration

Your config/sentry.php file must have DSN from your Sentry project.

'dsn'     => 'https://***:***@sentry.yourdomain.com/{project}'

You can configure Raven through the config/sentry.php config file. All the available options are already in there together with their default values.

You can find more details about the available options in Raven using this link:

https://github.com/getsentry/raven-php#configuration

By default notification would be send for warning level and more.

You can change log level with sentry.level config option, must be a Monolog number.

Monolog\Logger levels:

    DEBUG = 100;
    INFO = 200;
    NOTICE = 250;
    WARNING = 300;
    ERROR = 400;
    CRITICAL = 500;
    ALERT = 550;
    EMERGENCY = 600;

Testing

To test if your Sentry application is correctly grabbing your logs, simply launch php artisan tinker and execute a sample log like so:

$ php artisan tinker
>>> Log::error("This is a test error. Sentry should get this.");

Security

If you discover any security related issues, please email [email protected] or use the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History Chart