tko22 / flask-boilerplate

Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
https://github.com/tko22/flask-boilerplate/wiki
MIT License
301 stars 98 forks source link

How to view Flask exceptions when running in docker? #27

Closed bradparks closed 4 years ago

bradparks commented 4 years ago

First off, I'm a programmer, but have beginner level experience with Python and Docker ;-)

I've got the app running fine in Docker, but am trying to figure out the development process.

I've reviewed the docs, and blog post, but am not quite sure where to see the Flask exceptions when editing python files/running the app in docker?

I've tried tailing the api.log file, but it's only showing valid HTTP requests, and no exceptions.

I've also tried adding logger.info(error) to the global exception handler in api/core.py, but that didnt help either.

Any suggestions?

bradparks commented 4 years ago

ahh... I figured it out! It's mentioned briefly in the docs, but didnt mention exceptions or anything like that... Just run the following to tail the logs of the docker container:

$ docker-compose logs -f app

Briefly mentioned on this page: https://github.com/tko22/flask-boilerplate/wiki/Docker-Setup