0

I recently switched from Laravel 5.5 to 5.6

Everything's working fine except I can't seem to get logging to the Chrome console to work.

I used to do this in AppServiceProvider.php

$monolog            = Log::getMonolog();

if (config('app.env') === 'local') {
    $infohandler = new ChromePHPHandler(Logger::INFO, false);
    $infohandler->setFormatter(new ChromePHPFormatter());
    $monolog->pushHandler($infohandler);
}

The 'getMonolog' seems to have been removed. Anyone have quick solution to get this working again?

Kirk Olson
  • 554
  • 8
  • 16

2 Answers2

1

It appears to have been changed to Log::getLogger() which makes sense, it doesn't necessarily have to be Monolog anymore.

https://laravel.com/api/5.6/Illuminate/Log/Logger.html#method_getLogger

user1669496
  • 32,176
  • 9
  • 73
  • 65
0

in 5.6 if you're customising monolog you need to create a custom logging channel

https://laravel.com/docs/5.6/logging#creating-custom-channels

lucidlogic
  • 1,814
  • 13
  • 15