PHP code example of jenssegers / rollbar

1. Go to this page and download the library: Download jenssegers/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/ */

    

jenssegers / rollbar example snippets


Jenssegers\Rollbar\RollbarServiceProvider::class,

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