Open shaifulborhan opened 1 year ago
I am not sure why you are getting that error. NullHandler
is a part of monolog/monolog
itself and is an instance of the Monolog\Handler\HandlerInterface
interface.
I can offer a couple possibilities but none of them seem like a clear option.
php artisan config:cache
.monolog/monolog
available in your environment. Try running composer update monolog/monolog
followed by composer dump
.NullHandler
object in another package and accidentally, imported that instead of Monolog\Handler\NullHandler
.If none of those seem to resolve the issue and you still can't figure it out, please post the exact version installed for the following packages...
rollbar/rollbar
rollbar/rollbar-laravel
monolog/monolog
laravel/framework
Hello,
I have the same issue. I just followed the correct instructions:
[2023-03-15 22:07:20] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Rollbar\\Laravel\\MonologHandler must be an instance of Monolog\\Handler\\HandlerInterface at /.../vendor/laravel/framework/src/Illuminate/Log/LogManager.php:384)
Latest versions of the libraries + Laravel 10.
This can help:
@vbezruchkin what version of rollbar/rollbar-laravel
are you using?
Had this same issue occur to me using the following versions:
After closely reviewing the issue I noticed that I accidentally had set up the environment variable as ROLLBAR_token
instead of ROLLBAR_TOKEN
. So just be aware that this misconfiguration can result in this very same error.
Same issue here, please advise.
PHP v8.1.23
rollbar/rollbar 4.0.1 rollbar/rollbar-laravel 8.0.0 monolog/monolog 3.4.0 laravel/framework 10.24.0
My ROLLBAR_TOKEN
is set correctly in the .env
The error is slightly different:
[2023-09-29 13:56:32] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (Illuminate\\Contracts\\Container\\BindingResolutionException(code: 0): Unresolvable dependency resolving [Parameter #0 [ <required> array $config ]] in class Rollbar\\RollbarLogger
I looked into the Monolog upgrade instructions, but I can't immediately see anything that's relevant for the setup:
https://laravel.com/docs/10.x/upgrade#monolog-3
Current implementation:
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['rollbar', 'single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
],
'rollbar' => [
'driver' => 'monolog',
'handler' => \Rollbar\Laravel\MonologHandler::class,
'access_token' => env('ROLLBAR_TOKEN'),
'environment' => env('APP_NAME', 'production'),
'level' => 'warning',
],
It is possible this could be related to an autoloading issue. Try running...
composer dump
It is possible this could be related to an autoloading issue. Try running...
composer dump
Did not fix it for me unfortunately.
Laravel 8.x PHP 8.1.x rollbar/rollbar-laravel v7.2.0
My laravel.log file has been flooded with this error after updating PHP from 7.4.x to 8.1.x and rollbar/rollbar-laravel from 7.0.0 to 7.2.0.
I followed the installation here https://docs.rollbar.com/docs/laravel#laravel-6-through-9 but nothing needs to be updated as far as I am concerned because my Laravel version doesn't change.
Please advise.