PHP code example of captbrogers / laravel-rollbar

1. Go to this page and download the library: Download captbrogers/laravel-rollbar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

captbrogers / laravel-rollbar example snippets


Captbrogers\Rollbar\RollbarServiceProvider::class,

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

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

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

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

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

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

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