Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.6 Upgrade caused Logging to break

Heey!

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: 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) [ ....

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.

Has anyone run into this with a Laravel upgrade?

like image 839
cbloss793 Avatar asked Mar 02 '18 16:03

cbloss793


Video Answer


1 Answers

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

and add this to your .env file LOG_CHANNEL=stack

like image 131
MohamedBenhida Avatar answered Sep 22 '22 06:09

MohamedBenhida