Options: --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 , -n Number of lines to show from the end of the logs,default is all --timestamps , -t Show timestamps --until Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
注意
无
示例
1 2 3 4 5 6
# 查看实时日志 $ docker logs -f
$ docker run --name test -d busybox sh -c "while true; do $(echo date); sleep 1; done" $ date $ docker logs -f --until=2s test