#After updating to Laravel 9.0 I do not get error logs anymore

36 messages · Page 1 of 1 (latest)

unreal orchid
#

Hey, so when the server use to run into 500 errors and other errors it would log it to my local logs under storage/logs/laravel.log, but it doesn't seem to log anymore when it runs into 500 errors, is there anything that I need to change to enable this again?

cursive hemlock
#

hey

#

First thing: check the file permissions on the storage directory

Next thing: try and pull up the webserver logs to see if it's writing any errors to there

unreal orchid
#

-rw-rw-r-- 1 user user 3502 Jan 31 17:14 laravel-2023-01-31.log
-rw-rw-r-- 1 user user 45 Jan 31 17:04 laravel.log

#

This is all correct I believe

#

I tried logging directly through tinker also and that actually worked

#

The user is forge here, this was an old forge server

cursive hemlock
#

looks like maybe a mismatch between the user that runs your web app and the user that owns the files?

#

-rw-rw-r-- 1 user user <- is that what it's actually saying?

unreal orchid
#

Yeah well the user is forge

#

-rw-rw-r-- 1 forge forge

#

sudo chmod -R 777 storage/

#

Should i just run that maybe?

cursive hemlock
#

yeah worth a try, can't remember if 777 is right, 775 i think

unreal orchid
#

Okay let's give it a shot

#

Sadly that didn't work either:

Failed to open stream: Permission denied in /home/forge/api.myapp.com/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:190

#

Haha, oh this was you who shared this

cursive hemlock
#

i think nginx/php-fpm runs as the www-data user

#

so try

#

sudo chgrp -R www-data storage

#

sudo chmod -R ug+rwx storage

unreal orchid
#

Yesss, you're my hero

#

Thank you so much @cursive hemlock

#

Have to write those down

cursive hemlock
#

Np 🙂

#

mark the thread as solved if you can and you're happy

unreal orchid
#

For sure

#

Do you know why upgrading laravel would have messed that up?

cursive hemlock
#

not without knowing all the steps? did you upgrade laravel on your server, or on your local machine then deploy to forge?

unreal orchid
#

Local first

#

But oh well. I wrote this down for the next time i upgrade to just run through it again

#

Thank you for your time

cursive hemlock
#

np, if you did it local first, it might be that forge messed up the permissions on deploy, might be worth doing another deploy of a little code change to see if it does it again

#

that's assuming you're using Forge's deploy button