I suggest you to use upgrade guide https://laravel.com/docs/5.6/upgrade
[5.6] Laravel logging not working anymore?
Hello everybody,
I have recently upgraded to Laravel 5.6 (from 5.5) and I'm running into an issue where my the \Log() class doesn't work anymore.
At first it gave me the following error:
laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /home/vagrant/Code/grotesmurf/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:181)
which was caused by me not having the new /config/logging.php file, so that issue has been solved, but not that I do have the file, there are no new log entries created anymore at all, with the emergency error it atleast did output my logs.
I've tried using stack, single & daily as the LOG_CHANNEL, but to no avail.
I've temporarily set the permissions to 777 just to test if it was a permission error, but that's not the case. Setting it to 5xx causes a permission error, so it does actually try to access the file.
The command I'm running to test is just a simple \Log::info('hello') command inside of Laravel Tinker.
I'm running on php version 7.1.6.1 inside a vagrant box.
I've tried researching google about what's happening but all cases I've found either told me the OP to clear all cache or to add the logging.php file.
Hope anyone could give some suggestions on how to solve this issue.
Thanks in advance.
P.S. if you want more info, just ask :-)
Well I have found the issue.
My application uses an adjusted storage_path() method and since the new Logger uses the storage_path() method to generate it's filepath, it caused the log file to be generated in a different directory than storage/logs.
Please or to participate in this conversation.