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?
I was facing the same issue due to upgrade of my laravel version from 5.3 to 5.7. But after search of few mints i found the solution. You just need to follow the following steps.
All done. Happy Coding :)
I got the same problem and tried to do everything as you did but not work.
Finally, I've found that it was because of cached config, just clear it and everything will be fine:
I recently had the same error in my development machine (and not in the production one, oddly). In my development machine I have both
php 7.1
andphp 7.2
installed. Checking withphpinfo()
, I discovered that 7.1 was the default version, so I decided to switch to 7.2.That didn't solve the problem (but maybe was part of it).
After several hours spent on trying everything suggested around the web, I found my solution by:
In detail:
After this, I had no problem any more. Maybe try 0755 as permission for the storage folder. Hope this helps!
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
use upgrade guide , and add
logging.php
to your config files.After two days of some research, I found a solution on Github.
If you are using Laravel 5.5.4 to Laravel 5.6.*, then you can just install and configure the exceptions package by Graham Campbell.
Link: https://github.com/GrahamCampbell/Laravel-Exceptions
This worked perfectly for me on Mac OSX (PHP 7.1.7), Laravel 5.6.22
My initial error:
Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /Users/pro/Sites/metiwave/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:181)