I want to print error logs when I run command of docker-compose up
When I run command of docker-compose up
, there is no error which can occurs in my web application
But when i run command of docker-compose run web
, there is a error message which exactly i wanted.
this is my docker-compose.yml
version: '3'
services:
db:
image: postgres
web:
build: .
command: python zeus/manage.py runserver 0.0.0.0:8000
volumes:
- .:/zeus_test
ports:
- "8000:8000"
depends_on:
- db
Is there a way to print error logs when I run command of docker-compose up
?
This is my minimal reproduction
https://github.com/RayKimEX/mydocker-compose
When you run docker-compose run web
, the database container doesn't start up together, maybe that's the reason you get error.
But anyway, if you need know what exact errors in servie web
containers, I would run below commands to find error out.
docker-compose logs web
Or you only need logs with key word of error
docker-compose logs web |grep -i error
You can add -f
to catch latest logs.
-f, --follow Follow log output.
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