Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do my Python prints got with Flask deployed under nginx with uWSGI?

Following this tutorial I've just setup nginx with uWSGI to serve my website which I built in Flask, and things work fine for now.

I sometimes want to debug something for which I normally use basic print statements in the code. Unfortunately I have no idea where the result of these print's go?

I've tailed the following log files, but I don't see the print's in there:

/var/log/uwsgi/emperor.log
/var/log/uwsgi/myapp_uwsgi.log
/var/log/nginx/access.log
/var/log/nginx/error.log

Does anybody know where I can see the result of the prints?

like image 735
kramer65 Avatar asked Oct 27 '15 17:10

kramer65


1 Answers

normal print goes on stdout and Nginx log only stderr.

You should use the app.logger module of flask instead. Have a look at the flask documentation on error handling

like image 111
Lumy Avatar answered Oct 23 '22 16:10

Lumy