2017 © Pedro PelĆ”ez
 

library getsentry

Sentry Integration for Laravel 4

image

jcf/getsentry

Sentry Integration for Laravel 4

  • Tuesday, October 25, 2016
  • by jotafurtado
  • Repository
  • 1 Watchers
  • 3 Stars
  • 2,054 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Sentry Integration for Laravel 4

Sentry (getsentry.com) and Laravel 4 integration. Automatically send Laravel log messages to Sentry. This package integrates Sentry and Laravel 4 in a super simple way. Let's see how it works., (*1)

Installation

The package can be installed via Composer by requiring the jcf/getsentry package in your project's composer.json., (*2)

{
    "require": {
        "jcf/getsentry": "1.1.*"
    }
}

Then run a composer update, (*3)

php composer.phar update

After updating composer, add the ServiceProvider to the providers array in app/config/app.php, (*4)

'Jcf\Getsentry\GetsentryServiceProvider',

Configuration

Run php artisan config:publish jcf/getsentry to publish the configuration file., (*5)

php artisan config:publish jcf/getsentry

Edit the configuration file at /app/config/packages/jcf/getsentry. You may also create environment specific configuration files for your package by placing them in app/config/packages/jcf/getsentry/dev by example., (*6)

Options

Provide Sentry DSN of your project. You can grab this at Settings Tab / API Keys of your project on getsentry.com., (*7)

return array(

    'dsn' => 'https://1f68584cfb824d123432534ab452adb778:7e06629189c02355bd2b928881a4c1f1@app.getsentry.com/26241',

Then set the environments that should be reported to Sentry., (*8)

    'environments' => ['stagging', 'production'],

Set the log levels that should be reported to Sentry., (*9)

    'environments' => ['error', 'emergency', 'notice', 'info', 'debug'],

Set if Sentry Event ID should be saved in session. This is useful if you want to share the event ID with your users., (*10)

    'saveEventId' => true,

Usage

Automatically every message that will be logged by Laravel and that fits in rules of configuration will be sent to Sentry., (*11)

If you need, you may also trigger Laravel log mannualy and pass extra data to Sentry., (*12)

    // Debug with User and Extra Data
    \Log::debug('Debugging', [
    'user' => [
        'id' => 99,
        'email' => 'joao@3eengenharia.com.br',
        'data' =>[
            'Member Since' => '2011-09-07'
        ]
    ]
    , 'extra' => ['Ammount' => '142', 'Membership' => 'Activated']]
    );

    // Debug with User
    \Log::debug('Debug bug!', ['user' => 'jotafurtado']);

    // Info with User
    \Log::info('User has logged in.', ['user' => 'jotafurtado']);

    // Simple Error
    \Log::error('Image not saved.');

To retrieve event ID use the code:, (*13)

 \Session::get('sentryEventId');

The Versions

25/10 2016

dev-master

9999999-dev

Sentry Integration for Laravel 4

  Sources   Download

MIT

The Requires

 

by João Carlos

25/10 2016

1.1.0

1.1.0.0

Sentry Integration for Laravel 4

  Sources   Download

MIT

The Requires

 

by João Carlos

04/09 2014

dev-develop

dev-develop

Sentry Integration for Laravel 4

  Sources   Download

MIT

The Requires

 

by João Carlos

04/09 2014

1.0.0

1.0.0.0

Sentry Integration for Laravel 4

  Sources   Download

MIT

The Requires

 

by João Carlos