0a0dd116 |
% DOCKER(1) Docker User Manuals |
b07f1938 |
% Docker Community
% JUNE 2014 |
0a0dd116 |
# NAME
docker-logs - Fetch the logs of a container
# SYNOPSIS |
b07f1938 |
**docker logs** |
e6115a6c |
[**-f**|**--follow**] |
a2b529ea |
[**--help**] |
cb9a6b9a |
[**--since**[=*SINCE*]] |
e6115a6c |
[**-t**|**--timestamps**] |
5743cc34 |
[**--tail**[=*"all"*]] |
b07f1938 |
CONTAINER |
0a0dd116 |
# DESCRIPTION
The **docker logs** command batch-retrieves whatever logs are present for |
1b2b783b |
a container at the time of execution. This does not guarantee execution |
18a2c774 |
order when combined with a docker run (i.e., your run may not have generated |
1b2b783b |
any logs at the time you execute docker logs). |
0a0dd116 |
The **docker logs --follow** command combines commands **docker logs** and |
73257a72 |
**docker attach**. It will first return all logs from the beginning and |
19c43a69 |
then continue streaming new output from the container's stdout and stderr. |
0a0dd116 |
|
e611a189 |
**Warning**: This command works only for the **json-file** or **journald**
logging drivers. |
bdf3a029 |
|
0a0dd116 |
# OPTIONS |
a2b529ea |
**--help**
Print usage statement
|
bd9d14a0 |
**--details**=*true*|*false*
Show extra details provided to logs
|
b07f1938 |
**-f**, **--follow**=*true*|*false*
Follow log output. The default is *false*.
|
cb9a6b9a |
**--since**=""
Show logs since timestamp
|
b07f1938 |
**-t**, **--timestamps**=*true*|*false*
Show timestamps. The default is *false*. |
0a0dd116 |
|
d7904696 |
**--tail**="*all*" |
5743cc34 |
Output the specified number of lines at the end of logs (defaults to all logs)
|
2eee6133 |
The `--since` option can be Unix timestamps, date formatted timestamps, or Go |
19c43a69 |
duration strings (e.g. `10m`, `1h30m`) computed relative to the client machine's |
2eee6133 |
time. Supported formats for date formatted time stamps include RFC3339Nano, |
430d8ff6 |
RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`,
`2006-01-02Z07:00`, and `2006-01-02`. The local timezone on the client will be
used if you do not provide either a `Z` or a `+-00:00` timezone offset at the
end of the timestamp. When providing Unix timestamps enter
seconds[.nanoseconds], where seconds is the number of seconds that have elapsed
since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix
epoch or Unix time), and the optional .nanoseconds field is a fraction of a
second no more than nine digits long. You can combine the `--since` option with
either or both of the `--follow` or `--tail` options. |
4e3b21f9 |
|
bd9d14a0 |
The `docker logs --details` command will add on extra attributes, such as
environment variables and labels, provided to `--log-opt` when creating the
container.
|
0a0dd116 |
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
fa29b1f0 |
based on docker.com source material and internal work. |
b07f1938 |
June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
5743cc34 |
July 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
cb9a6b9a |
April 2015, updated by Ahmet Alp Balkan <ahmetalpbalkan@gmail.com> |
430d8ff6 |
October 2015, updated by Mike Brown <mikebrow@gmail.com> |