How to check error logs for flask/uwsgi/nginx app?

Posted April 18, 2015 93.5k views
UbuntuPython FrameworksLogging

I am trying to follow this tutorial

I can run python, it starts correctly on port 5000. When trying to access it to check everything works by going to serverip:5000, I got an internal server error. Where are the errors logged? How can I debug it? I don’t want to proceed to the next step until it is fixed.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Before running the uwsgi ini file you will need to add a line to it to create logs.

Something like:

#location of log files
logto = /var/log/uwsgi/%n.log

uwsgi docs

Then you will have to create the directory in your VPS (not that you can create the directory in whatever path you want, as long as it’s the path that you have in the ini file):

sudo mkdir -p /var/log/uwsgi
sudo chown -R user:user /var/log/uwsgi

If you want to see the logs you can cat command them in the terminal.

Nginx error logs default location is:


As for debugging (correctly) that is a skill beyond my current abilities!

Thank you for your help! Saved the day!