Skip to content

How to live tail Docker logs?

To view docker logs we use the docker logs command.

docker logs <container-id>
Advertisements

We would usually want to view live logs from a file using tail linux command. But this doesn’t work with docker logs. We need send –follow flag to docker logs command to tail logs.

docker logs --follow <container-id>

An example:

Advertisements
docker logs --follow ca5947cbaac1

This would tail the currently logged text in the docker log file.

See also  Login to Docker container with root privileges

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.