You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used Monolog Channel with NullHandler on Laravel 5.8. It is worked fine.
But Laravel 6.0 throw following exception.
[2019-09-18 09:59:05] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (Error(code: 0): Call to undefined method Monolog\\Handler\\NullHandler::setFormatter() at /vagrant/server/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:376)
[stacktrace]
#0 /vagrant/server/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(347): Illuminate\\Log\\LogManager->prepareHandler(Object(Monolog\\Handler\\NullHandler), Array)
#1 /vagrant/server/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(185): Illuminate\\Log\\LogManager->createMonologDriver(Array)
I guess it is Monolog 1.x -> 2.0 compatibility problem.
Laravel 6.0 newly depend on Monolog 2.0 instead 1.x.
Illuminate/Log/LogManager.php use Monolog\Handler\HandlerInterface.
The interface has setFormatter() in Monolog 1.x (old).
However In Monolog 2.0, setFormatter() moved to Monolog\Handler\FormattableHandlerInterface.
LogManager must check FormattableHandlerInterface before call setFormatter() if there are Monolog 2.0.
Description:
I used Monolog Channel with NullHandler on Laravel 5.8. It is worked fine.
But Laravel 6.0 throw following exception.
I guess it is Monolog 1.x -> 2.0 compatibility problem.
Laravel 6.0 newly depend on Monolog 2.0 instead 1.x.
Illuminate/Log/LogManager.php
useMonolog\Handler\HandlerInterface
.The interface has
setFormatter()
in Monolog 1.x (old).However In Monolog 2.0,
setFormatter()
moved toMonolog\Handler\FormattableHandlerInterface
.LogManager must check
FormattableHandlerInterface
before callsetFormatter()
if there are Monolog 2.0.Steps To Reproduce:
My
config/logging.php
is following.The text was updated successfully, but these errors were encountered: