Skip to content

Get logs of docker container

Get running containers

It will display something like the below

img.png

We will be targeting the first container running

Stream the logs

docker logs -f db129cf0407d

This command streams the logs coming out of the docker container to your cli

Short Container ID

We don't have to use the entire long CONTAINER ID, we can use the first 3 characters.

docker logs -f db129cf0407d
docker logs -f db1

Additional Reading

View Container Logs (Docker website)


Want to make this site better? Open a PR or help fund hosting costs