docker logs实时查看日志tail

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, shorthandDefaultDescription
--detailsShow extra details provided to logs
--follow , -fFollow log output
--sinceShow logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)
--tailallNumber of lines to show from the end of the logs
--timestamps , -tShow timestamps
--untilShow logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes)

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐