github.com/tompao/docker@v1.9.1/docs/reference/commandline/logs.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "logs"
     4  description = "The logs command description and usage"
     5  keywords = ["logs, retrieve, docker"]
     6  [menu.main]
     7  parent = "smn_cli"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # logs
    12  
    13      Usage: docker logs [OPTIONS] CONTAINER
    14  
    15      Fetch the logs of a container
    16  
    17        -f, --follow=false        Follow log output
    18        --help=false              Print usage
    19        --since=""                Show logs since timestamp
    20        -t, --timestamps=false    Show timestamps
    21        --tail="all"              Number of lines to show from the end of the logs
    22  
    23  > **Note**: this command is available only for containers with `json-file` and
    24  > `journald` logging drivers.
    25  
    26  The `docker logs` command batch-retrieves logs present at the time of execution.
    27  
    28  The `docker logs --follow` command will continue streaming the new output from
    29  the container's `STDOUT` and `STDERR`.
    30  
    31  Passing a negative number or a non-integer to `--tail` is invalid and the
    32  value is set to `all` in that case.
    33  
    34  The `docker logs --timestamp` commands will add an [RFC3339Nano timestamp](https://golang.org/pkg/time/#pkg-constants)
    35  , for example `2014-09-16T06:17:46.000000000Z`, to each
    36  log entry. To ensure that the timestamps for are aligned the
    37  nano-second part of the timestamp will be padded with zero when necessary.
    38  
    39  The `--since` option shows only the container logs generated after
    40  a given date. You can specify the date as an RFC 3339 date, a UNIX
    41  timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Docker computes
    42  the date relative to the client machine’s time. You can combine
    43  the `--since` option with either or both of the `--follow` or `--tail` options.