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, 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)

转载于:https://www.jianshu.com/p/511ad014d279

猜你喜欢

转载自blog.csdn.net/weixin_33724659/article/details/91233910