rollbar / rollbar-php-laravel

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

Unable to create configured logger #93

Closed Mattnmoore closed 2 years ago

Mattnmoore commented 4 years ago

After upgrading to Laravel 6.*, I've encountered an error while trying to use Rollbar.

Unable to create configured logger. Using emergency logger. {"exception":"[object] (TypeError(code: 0): Argument 1 passed to Monolog\\Handler\\RollbarHandler::__construct() must be an instance of RollbarNotifier, instance of Rollbar\\RollbarLogger given, called in /vagrant/api/vendor/rollbar/rollbar-laravel/src/RollbarServiceProvider.php on line 54 at /vagrant/api/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php:68)

I'm on the dev-master branch of rollbar/rollbar-laravel and the following is my config.

        'rollbar' => [
            'driver' => 'monolog',
            'handler' => \Rollbar\Laravel\MonologHandler::class,
            'access_token' => env('ROLLBAR_TOKEN'),
            'level' => env('ROLLBAR_LEVEL')
        ]

Any help would be appreciated.

Mattnmoore commented 4 years ago

It looks like MonologHandler.php might be extending the wrong class...If you replaceMonolog\Handler\RollbarHandler with Rollbar\Monolog\Handler\RollbarHandler it seems to correct the issue.

letaniaferreira commented 4 years ago

related issue https://github.com/rollbar/rollbar-php/issues/249

bxsx commented 3 years ago

Related issue: https://github.com/rollbar/rollbar-php-symfony-bundle/pull/63/

danielmorell commented 2 years ago

The correct handler should be Monolog\Handler\RollbarHandler.