Languages
[Edit]
EN

Docker - show logs of container

2 points
Created by:
Abel-Burks
698

Quick solution:

# follow short
docker logs -f <container_id>

# follow full
docker logs --follow <container_id>

# since
docker logs --since=42m <container_id>
docker logs --since=2h <container_id>

# to get <container_id> we use:
docker ps

 

Documentation:

Name, shorthandDefaultDescription
--details Show extra details provided to logs
--follow , -f Follow log output
--since Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
--tail , -nallNumber of lines to show from the end of the logs
--timestamps , -t Show timestamps
--until API 1.35+
Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)

 

References:

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Docker - useful wiki posts

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join