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**
[**-f**|**--follow**[=*false*]] |
a2b529ea |
[**--help**] |
cb9a6b9a |
[**--since**[=*SINCE*]] |
b07f1938 |
[**-t**|**--timestamps**[=*false*]] |
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 |
0a0dd116 |
then continue streaming new output from the container’s stdout and stderr.
|
e611a189 |
**Warning**: This command works only for the **json-file** or **journald**
logging drivers. |
bdf3a029 |
|
0a0dd116 |
# OPTIONS |
a2b529ea |
**--help**
Print usage statement
|
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 |
|
5743cc34 |
**--tail**="all"
Output the specified number of lines at the end of logs (defaults to all logs)
|
4e3b21f9 |
The `--since` option shows only the container logs generated after
a given date. You can specify the date as an RFC 3339 date, a UNIX
timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes
the date relative to the client machine’s time. You can combine
the `--since` option with either or both of the `--follow` or `--tail` options.
|
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> |