Using Rollbar with Vapor cover image

Using Rollbar with Vapor

Andréia Bohner • January 25, 2021

configuration laravel

As I couldn't find on docs, maybe this will help someone to save time :)

You'll only have to change a few configurations to get Rollbar working with Vapor.

On your .env.production add this env var:

LOG_CHANNEL=vapor

And in your Laravel logging config:

// config/logging.php

return [
       'channels' => [
            'vapor' => [
                'driver'            => 'stack',
                'channels'          => ['rollbar', 'stderr'],
                'ignore_exceptions' => false,
            ],

            'rollbar' => [
                'driver'        => 'monolog',
                'handler'       => \Rollbar\Laravel\MonologHandler::class,
                'access_token'  => env('ROLLBAR_TOKEN'),
                'level'         => 'debug',
                'person_fn'     => 'Auth::user',
                'capture_email' => true,
            ],
        ],
];

Found this similar solution on Flare config :)