2017 © Pedro Peláez
 

library rollbar-laravel

Rollbar error monitoring integration for Laravel projects

image

potsky/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

  • Wednesday, June 21, 2017
  • by potsky
  • Repository
  • 1 Watchers
  • 1 Stars
  • 422 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 79 Forks
  • 0 Open issues
  • 21 Versions
  • 116 % Grown

The README.md

Laravel Rollbar

Installation

Install using composer:, (*1)

composer require potsky/rollbar-laravel

Add Project Access Token post_server_item from Rollbar.com -> Settings -> Project Access Tokens to .env:, (*2)

ROLLBAR_TOKEN=[your Rollbar project access token]

Add the service provider to the 'providers' array in config/app.php:, (*3)

Rollbar\Laravel\RollbarServiceProvider::class,

If you only want to enable Rollbar reporting for certain environments you can conditionally load the service provider in your AppServiceProvider:, (*4)

if ($this->app->environment('production')) {
    $this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class);
}

Configuration

This package supports configuration through the services configuration file located in config/services.php. All configuration variables will be directly passed to Rollbar:, (*5)

'rollbar' => [
    'access_token' => env('ROLLBAR_TOKEN'),
    'level' => env('ROLLBAR_LEVEL'),
    'person_fn' => function() {
        if (Auth::user()) {
            return [
                'id'       => strval(Auth::user()->id),
                'username' => strval(Auth::user()->name),
                'email'    => strval(Auth::user()->email),
            ];
        } else {
            return [];
        }
    }
],

The level variable defines the minimum log level at which log messages are sent to Rollbar. For development you could set this either to debug to send all log messages, or to none to sent no messages at all. For production you could set this to error so that all info and debug messages are ignored., (*6)

If you compile configuration files, do not use a callback function directly. Define the function in a helper include for example and configure the service like this :, (*7)

'rollbar' => [
    'access_token' => env('ROLLBAR_TOKEN'),
    'level' => env('ROLLBAR_LEVEL'),
    'person_fn' => 'get_rollbar_person'
],

In the helper file:, (*8)

function get_rollbar_person() {
    if (Auth::user()) {
        return [
            'id'       => strval(Auth::user()->id),
            'username' => strval(Auth::user()->name),
            'email'    => strval(Auth::user()->email),
        ];
    } else {
        return [];
    }
}

Usage

Fatal error and exceptions handled by Laravel are automatically sent to Rollbar. You do not need to add something in app/Exceptions/Handler.php., (*9)

Your other log messages will also be sent to Rollbar:, (*10)

\Log::debug('Here is some debug information');

Context informaton

You can pass extra information:, (*11)

\Log::warning('Something went wrong', [
    'download_size' => 3432425235
]);

The Versions

21/06 2017

dev-master

9999999-dev https://github.com/potsky/rollbar-php-laravel

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artur Moczulski

laravel logging error monitoring rollbar

21/06 2017

v2.0.1

2.0.1.0 https://github.com/potsky/rollbar-php-laravel

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artur Moczulski

laravel logging error monitoring rollbar

30/04 2017

v2.0.0

2.0.0.0 https://github.com/rollbar/rollbar-php-laravel

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artur Moczulski

laravel logging error monitoring rollbar

25/01 2017

v1.5.1

1.5.1.0 https://github.com/jenssegers/laravel-rollbar

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

20/03 2016

v1.5.0

1.5.0.0 https://github.com/jenssegers/laravel-rollbar

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

17/01 2016

v1.4.6

1.4.6.0 https://github.com/jenssegers/laravel-rollbar

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

13/12 2015

v1.4.5

1.4.5.0 https://github.com/jenssegers/laravel-rollbar

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

06/06 2015

v1.4.4

1.4.4.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

24/05 2015

v1.4.3

1.4.3.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

19/04 2015

v1.4.2

1.4.2.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

08/02 2015

v1.4.1

1.4.1.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

08/02 2015

v1.4.0

1.4.0.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

15/06 2014

v1.3.4

1.3.4.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

10/06 2014

v1.3.3

1.3.3.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

28/05 2014

v1.3.2

1.3.2.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

04/05 2014

v1.3.1

1.3.1.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

02/05 2014

v1.3.0

1.3.0.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

02/05 2014

v1.2.0

1.2.0.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

30/04 2014

v1.1.0

1.1.0.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

28/04 2014

v1.0.1

1.0.1.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar

27/04 2014

v1.0.0

1.0.0.0

Rollbar error monitoring integration for Laravel projects

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel logging error monitoring rollbar