laravel-debugbar: [Laravel 5.6] Call to undefined method Monolog\Logger::getMonolog()

On Laravel 5.6 I get this error.

Call to undefined method Monolog\Logger::getMonolog()

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 18
  • Comments: 17

Most upvoted comments

In Laravel 5.6 Logger::getMonolog() does not exist. you may try Logger::getLogger()

I do not have the debugbar package in my composer.json project, still:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In Logger.php line 276:
                                                         
  Call to undefined method Monolog\Logger::getMonolog() 

I used Log::getLogger() and worked fine.

I have the same error too!

I did a composer cleancache and deleted vendor/* -rf… then edited composer.json to use laravel/framework@5.6.*, minimum stability is dev, still composer fetches a wrong Illuminate Logger code, which calls that function that seems to not exist anymore…

worth noticing I added the missing .env and logging.php new entries for this laravel upgrade, I still get the old version of the logger.php Illuminate, which makes that wrong call