laravel5.8的日志记录报错了,
我在控制器中引入
use Illuminate\Support\Facades\Log; //引入的库文件
然后在方法中
Log::useDailyFiles(base_path(‘storage/logs/abc.log’), 7);
Log::critiack(“test”);
就一直报错,为什么呢,我在配置文件 loggging.php中已经设置了daily
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single','daily'],
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 7,
],
但是一直报这个错, Call to undefined method Monolog\Logger::useDailyFiles()
没在 5.8 中有看到这个方法,5.5 中倒是有。