André Amorim

Crafting Web Experiences

//

See the Docker logs in terminal

For Docker Compose

This will show logs in all services defined in docker-compose.yml file:

docker-compose logs

If you want it to watch all the new logs interactively, use the –follow flag:

docker-compose logs --follow

You might want to see only last 100 records in the screen:

docker-compose logs --follow --tail=100

You can also see the logs only for specific services in docker-compose.yml:

docker-compose logs <service_name(s)> --follow --tail=100

Any Docker Container

docker logs <container_name_or_id>
docker logs <container_name_or_id> --follow --tail=100

Reference:
1. https://docs.docker.com/engine/reference/commandline/compose_logs/
2. https://docs.docker.com/engine/reference/commandline/logs/


Published date:

Modified date: