1

The app is running on Heroku, but the issue when running is how to avoid the unhelpful error message of Internal Server Error and get more verbose error messages. For example, in the production environment, even with app.debug set to True, I still get no debug.

It would seem the smart thing to do, is to log everything to a file, but I don't see some working examples that do that. I simply want to write to a file for example. Is there any minimum working sample code that I can see that does this, outputting application errors?

Of course my app has the following settings:

app.run(debug = True)

My Procfile is:

web: gunicorn login:app
disruptive
  • 5,687
  • 15
  • 71
  • 135

1 Answers1

1

Heroku will catch any log you send to STDOUT and STDERR and make it available in their logging pipeline: https://devcenter.heroku.com/articles/logging
You can then access your app's logs with the heroku logs command.

You can configure gunicorn to send logs to STDOUT with the --log-file - option.
See https://devcenter.heroku.com/articles/python-gunicorn#adding-gunicorn-to-your-application-procfile

Damien MATHIEU
  • 31,924
  • 13
  • 86
  • 94
  • I can write manual comments - but I want to catch the errors from the application, however I cannot seem to do this with the settings above. – disruptive Oct 05 '15 at 13:46