2017 © Pedro Peláez
 

library raven-php

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

image

twineis/raven-php

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  • Monday, April 3, 2017
  • by twineis
  • Repository
  • 3 Watchers
  • 8 Stars
  • 17,120 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 7 Versions
  • 5 % Grown

The README.md

Raven PHP

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues, (*1)

License Latest Version Total Downloads, (*2)

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues. This will add a listener to Laravel's existing log system. It makes use to Laravel's queues to push messages into the background without slowing down the application., (*3)

rollbar, (*4)

Installation

Install the latest version with:, (*5)

$ composer require twineis/raven-php

For Laravel add the service provider in config/app.php:, (*6)

Twine\Raven\Providers\LaravelServiceProvider::class,

Register the Raven alias:, (*7)

'Raven' => Twine\Raven\Facades\Raven::class,

For Lumen add the following to bootstrap/app.php, (*8)

$app->register(Twine\Raven\Providers\LumenServiceProvider::class);

Configuration

Publish the included configuration file (Laravel only):, (*9)

$ php artisan vendor:publish

Change the Sentry DSN by using the RAVEN_DSN env variable or changing the config file:, (*10)

RAVEN_DSN=your-raven-dsn

This library uses the queue system, make sure your config/queue.php file is configured correctly. You can also specify the connection and the queue to use in the raven config. The connection and queue must exist in config/queue.php. These can be set using the RAVEN_QUEUE_CONNECTION for connection and RAVEN_QUEUE_NAME for the queue., (*11)

RAVEN_QUEUE_CONNECTION=redis
RAVEN_QUEUE_NAME=error

The job data can be quite large, ensure you are using a queue that can support large data sets like redis or sqs. If the job fails to add into the queue, it will be sent directly to sentry, slowing down the request, so its not lost., (*12)

Usage

To monitor exceptions, simply use the Log facade or helper:, (*13)

Log::error($exception);

// or

app('log')->error($exception);

You can change the logs used by changing the log level in the config by modifying the env var., (*14)

RAVEN_LEVEL=error

Event Id

There is a method to get the last event id so it can be used on things like the error page., (*15)

Raven::getLastEventId();

Context information

You can pass additional information as context like this:, (*16)

Log::error('Oops, Something went wrong', [
    'user' => ['name' => $user->name, 'email' => $user->email]
]);

Credits

This package was inspired rcrowe/Raven., (*17)

The Versions

03/04 2017

dev-master

9999999-dev

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry

03/04 2017

0.5.0

0.5.0.0

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry

08/12 2016

0.4.0

0.4.0.0

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry

07/12 2016

0.3.1

0.3.1.0

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry

29/10 2016

0.3.0

0.3.0.0

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry

01/06 2016

0.2.0

0.2.0.0

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry

20/04 2016

0.1.0

0.1.0.0

Sentry (Raven) error monitoring for Laravel and Lumen with send in background via queues

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging raven sentry error monitoring getsentry