docker logs实时查看日志tail
2019-06-06 本文已影响0人
哪个鹿
docker logs -f -t --since="2017-05-31" --tail=10 container
- 说明:
--since : 指定输出日志开始日期。
-f : 查看实时日志
-t : 查看日志产生的时间戳
-tail=10 : 查看最后的10条日志。
container : 容器名
docker logs -f --until=2s
- 说明:
相对时间(relative):2013-01-02T13:23:37
绝对时间(timestamp):42m for 42 minutes
docker logs [OPTIONS] CONTAINER
Options
Name, shorthand | Default | Description |
---|---|---|
--details |
Show extra details provided to logs | |
--follow , -f |
Follow log output | |
--since |
Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) | |
--tail |
all |
Number of lines to show from the end of the logs |
--timestamps , -t |
Show timestamps | |
--until |
Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) |