kramer65
kramer65

Reputation: 53873

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?

Upvotes: 6

Views: 2282

Answers (1)

Lumy
Lumy

Reputation: 399

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

Upvotes: 3

Related Questions