I am trying to debug an application I made with django and it works fine using django’s manage.py, but when I use nginx some features do not work. I checked the error logs and they are empty, probably because I am catching all exceptions and sending them to standard out. Is there an easy way to see the output from the application with nginx?
Share
WSGI servers often disable stdout, I think because it can cause some sort of compatibility problems. Django has built-in logging; I’d suggest using that instead of print statements. It should both be easier to configure and also allow you to have more specificity in your logging, i.e. :
log.debug(‘only seen while debugging’)
or
log.warn(‘this message might indicate a problem’)
Relevant django docs:
https://docs.djangoproject.com/en/dev/topics/logging/