rollbar / rollbar-php-laravel

Rollbar error monitoring integration for Laravel projects
https://docs.rollbar.com/docs/laravel
140 stars 39 forks source link

Add support for rollbar-agent #109

Closed bishopb closed 3 years ago

bishopb commented 3 years ago

Description of the change

The configuration for logging in Laravel requires an instance of Monolog\Handler\HandlerInterface, but the Rollbar library requires a string with value of "agent" to use the agent. This disconnect makes it impossible to use the Rollbar agent with Laravel.

Fixes Issue #85, by way of an adapter class. An example Laravel configuration to use the adapter:

'rollbar' => [
      'driver' => 'monolog',
      'handler' => \Rollbar\Laravel\AgentHandler::class,
      'level' => 'debug',
      'access_token' => env('ROLLBAR_TOKEN'),
      'environment' => 'production'
],

Type of change

Related issues

Fixes Issue #85.

Checklists

Development

Code review