I’ve recently moved over to using Valet for local development, it had its ups and downs and has been a bit of a learning curve as I’m used to using Apache not Nginx as a web server.

I’m really documenting this as my own handbook but if others can benefit from it then so be it!

Something that kept tripping me up was where to access the logs to diagnose issues as they arise, inevitably as developers we have to make tweaks to our settings and configurations so monitoring the logs when errors occur are essential.

My server was running fine until I updated something, then on certain pages of my app I was getting a 502 Bad Gateway error! So, first I need to monitor the logs. Turns out on my local Mac environment the logs for Nginx are in the following folder:

/Users/[insert-your-user]/.config/valet/Log

So from here you can load a terminal and run the following command to monitor the logs.

$ cd /Users/[insert-your-user]/.config/valet/Log

in this folder, I found a log file called ‘nginx-error.log’

So, now I can run the following command and watch the log whilst refreshing the browser to see what gets logged.