dongqiyou0303 2018-04-12 12:51
浏览 218

Laravel 5.6 Monolog在Chrome控制台中输出

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?

  • 写回答

2条回答 默认 最新

  • donglu7998 2018-04-12 12:54
    关注

    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

    评论

报告相同问题?