• Stars
    star
    333
  • Rank 121,824 (Top 3 %)
  • Language
    PHP
  • Created about 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rollbar error monitoring integration for Laravel projects

Laravel Rollbar

Build Status Coverage Status

Rollbar error monitoring integration for Laravel projects. This library adds a listener to Laravel's logging component. Laravel's session information will be sent in to Rollbar, as well as some other helpful information such as 'environment', 'server', and 'session'.

rollbar

Installation

Install using composer:

composer require jenssegers/rollbar

Add the service provider to the 'providers' array in config/app.php:

Jenssegers\Rollbar\RollbarServiceProvider::class,

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

    public function register()
    {
        if ($this->app->environment('production')) {
            $this->app->register(\Jenssegers\Rollbar\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:

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

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.

Usage

To automatically monitor exceptions, simply use the Log facade in your error handler in app/Exceptions/Handler.php:

public function report(Exception $exception)
{
    \Log::error($exception); //rollbar
    parent::report($exception);
}

For Laravel 4 installations, this is located in app/start/global.php:

App::error(function(Exception $exception, $code)
{
    Log::error($exception);
});

Your other log messages will also be sent to Rollbar:

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

NOTE: Fatal exceptions will always be sent to Rollbar.

Context informaton

You can pass user information as context like this:

\Log::error('Something went wrong', [
    'person' => ['id' => 123, 'username' => 'John Doe', 'email' => '[email protected]']
]);

Or pass some extra information:

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

More Repositories

1

agent

👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
PHP
4,417
star
2

imagehash

🌄 Perceptual image hashing for PHP
PHP
1,940
star
3

date

🗓 A library to help you work with dates in multiple languages, based on Carbon.
PHP
1,813
star
4

optimus

🤖 Id obfuscation based on Knuth's multiplicative hashing method for PHP.
PHP
1,254
star
5

php-proxy

A PHP proxy script with https and post support
PHP
922
star
6

blade

🔪 A standalone version of Laravel's Blade templating engine for use outside of Laravel.
PHP
752
star
7

model

This model provides an eloquent-like base class that can be used to build custom models in Laravel and other frameworks
PHP
348
star
8

RTL8188-hostapd

hostapd for Realtek RTL8188
C
334
star
9

laravel-ab

A server-side A/B testing tool for Laravel.
PHP
285
star
10

captain

⚓️ Easily start and stop docker compose projects
Go
231
star
11

codeigniter-hmvc-modules

Create HMVC modules with this lightweight extension for Codeiginter 2
PHP
187
star
12

codeigniter-advanced-images

Resize and crop images on the fly
PHP
181
star
13

dashboard

A server dashboard for Ubuntu
PHP
136
star
14

codeigniter-template-library

A template library for Codeigniter
PHP
107
star
15

laravel-raven

Sentry (Raven) error monitoring integration for Laravel projects
PHP
91
star
16

laravel-mongodb-session

A MongoDB session driver for Laravel
PHP
75
star
17

codeigniter-authentication-library

A secure authentication library for CodeIgniter
PHP
67
star
18

laravel-oauth

A Laravel OAuth 1 & 2 library
PHP
65
star
19

laravel-mongodb-sentry

An extension for Laravel-MongoDB that lets you work with Sentry
PHP
53
star
20

codeigniter-message-library

Store and display error or information messages to display on the current page or next page
PHP
51
star
21

lean

Use the PHP League's Container package with auto-wiring support as the core container in Slim 3
PHP
31
star
22

laravel-mongodb-core

A MongoDB based query builder for Laravel
PHP
25
star
23

php-chef

Opscode Chef API PHP library
PHP
20
star
24

chef-patch

Helps you replace text and lines in files from Chef recipes.
Ruby
20
star
25

palenight.zsh-theme

My custom zsh theme
13
star
26

laravel-mongodb-lite

A lightweight MongoDB database library and model for Laravel 4
PHP
11
star
27

vagrant

My personal Vagrant development environment
HTML
7
star
28

docker

My personal Docker setup
5
star
29

docker-php-cs-fixer

A tool to automatically fix PHP coding standards issues
4
star
30

quotebot

Quotebot for slack
TypeScript
4
star
31

ddd-oke-cars

PHP
4
star
32

docker-php

Custom PHP docker image with some basic extensions
Dockerfile
4
star
33

cryptonope

Replace crypto words with random things
JavaScript
3
star
34

homebrew-custom

Custom homebrew formulas
Ruby
2
star
35

spacegray-monokai

A Monokai color scheme for Sublime's Spacegray theme
1
star