I've deployed a python flask app on an apache server. Here is my abc.conf file:
WSGIDaemonProcess voting_app threads=5
WSGIScriptAlias /election /var/www/voting_app/voting.wsgi
LogLevel info
ErrorLog "/var/www/voting_app/error.log"
CustomLog "/var/www/voting_app/access.log" combined
<Directory /var/www/voting_app>
WSGIProcessGroup voting_app
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
To check debugging I made a syntax error in my application. On restarting the server, I am getting a 500 server error but I cant see the details of the error anywhere. I checked the two files I added as logs - they're completely blank. So are the log files in /var/log/apache2. What am I missing here?
When running Flask in a production setting, rather than with the built in development server, it will convert application exceptions into HTTP 500 responses but not log anything. So what you are seeing is normal.
If you are the only one viewing the site, you can enable debug mode temporarily like would be done automatically with the development server. For how to do this see:
http://flask.pocoo.org/docs/quickstart/#debug-mode
Specifically:
app.debug = True
where 'app' is the Flask class instance.
This will cause details of errors to be shown in the browser making the request.
On a true production system you obviously shouldn't be using that so in that case you should set up Flask to log such application errors. For that see:
http://flask.pocoo.org/docs/errorhandling/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With