See the Docker logs in terminal

For Docker Compose

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

docker-compose logsCode language: Bash (bash)

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

docker-compose logs --followCode language: Bash (bash)

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

docker-compose logs --follow --tail=100Code language: Bash (bash)

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

docker-compose logs <service_name(s)> --follow --tail=100Code language: Bash (bash)

Any Docker Container

docker logs <container_name_or_id>Code language: Bash (bash)
docker logs <container_name_or_id> --follow --tail=100Code language: Bash (bash)

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


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.