简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM