I have developed an app in Flask, which connects to a database. In development (in VS Code), if the app tries to connect to an incorrect ip-address for the database, I will get an error in the console. In 'production' where Flask runs under Gunicorn in a Docker container, where can I see this error message.
In the Docker setup I have a Dockerfile for defining the image and a compose file for executing the container. I have tried setting the --error-logfile in the Dockerfile on the CMD and also to set it as an environment variable in the settings file referenced in the YAML file. In any case, I cannot find out where to see the error message.
You can see your logs with docker logs or docker-compose logs : docker logs -f <YOUR CONTAINER>
.
With this commands, you'll see all your errors and shell messages.
If you want to access your file inside your Docker container, you can run this command to go inside your container : docker exec -it <CONTAINER ID> bash
and then go to your log file directory and display it.