Laravel 5.6升级导致记录中断 [英] Laravel 5.6 Upgrade caused Logging to break

查看:49
本文介绍了Laravel 5.6升级导致记录中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!

所以我最近被赋予了将Laravel 5.2升级到5.6的任务.似乎很好...直到我尝试执行\Log::info()为止.每次运行该命令时,都会遇到一个大错误,但是最后,它仍然会打印到日志中.我看到了有关创建config/logger.php的5.6文档.我从github获得了它的新副本.在那之后,我所做的唯一一件事就是将LOG_CHANNEL的env变量设置为单个.这是我得到的错误:

So I've recently been given the task to take a Laravel 5.2 up to 5.6. It seemed to be fine...until I tried to do a \Log::info(). Every time I run that, I get a big error, but at the end, it still prints to the log. I saw the 5.6 documentation on creating the config/logger.php. I took a fresh copy of it from github. The only thing I did after that was set an env variable for the LOG_CHANNEL to be single. Here's the error I get:

[2018-03-02 08:28:59] laravel.EMERGENCY:无法创建配置的记录器.使用紧急记录器. {"exception":"[对象](InvalidArgumentException(代码:0):未定义日志[].位于I:\ xampp \ htdocs \ mtm \ vendor \ laravel \ framework \ src \ Illuminate \ Log \ LogManager.php: 181) [....

[2018-03-02 08:28:59] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at I:\xampp\htdocs\mtm\vendor\laravel\framework\src\Illuminate\Log\LogManager.php:181) [ ....

我在Laravel 5.2和5.6之间进行了文件比较.我没有看到任何会破坏日志记录功能的信息.

I did a file comparison between Laravel 5.2 and 5.6. I'm not seeing anything that jumps out that would break the Logging functionality.

有人用Laravel升级遇到了这个问题吗?

Has anyone run into this with a Laravel upgrade?

推荐答案

将此文件添加到您的配置文件夹中 https://github.com/laravel/laravel/blob/develop/config /logging.php

Add this file to your config folder https://github.com/laravel/laravel/blob/develop/config/logging.php

并将其添加到您的.env文件LOG_CHANNEL=stack

and add this to your .env file LOG_CHANNEL=stack

这篇关于Laravel 5.6升级导致记录中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆