github.com/justincormack/cli@v0.0.0-20201215022714-831ebeae9675/man/src/container/logs.md (about)

     1  The **docker container logs** command batch-retrieves whatever logs are present for
     2  a container at the time of execution. This does not guarantee execution
     3  order when combined with a docker run (i.e., your run may not have generated
     4  any logs at the time you execute docker container logs).
     5  
     6  The **docker container logs --follow** command combines commands **docker container logs** and
     7  **docker attach**. It will first return all logs from the beginning and
     8  then continue streaming new output from the container's stdout and stderr.
     9  
    10  **Warning**: This command works only for the **json-file** or **journald**
    11  logging drivers.
    12  
    13  The `--since` and `--until` options can be Unix timestamps, date formatted timestamps, 
    14  or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the client machine's
    15  time. Supported formats for date formatted time stamps include RFC3339Nano,
    16  RFC3339, `2006-01-02T15:04:05`, `2006-01-02T15:04:05.999999999`,
    17  `2006-01-02Z07:00`, and `2006-01-02`. The local timezone on the client will be
    18  used if you do not provide either a `Z` or a `+-00:00` timezone offset at the
    19  end of the timestamp.  When providing Unix timestamps enter
    20  seconds[.nanoseconds], where seconds is the number of seconds that have elapsed
    21  since January 1, 1970 (midnight UTC/GMT), not counting leap  seconds (aka Unix
    22  epoch or Unix time), and the optional .nanoseconds field is a fraction of a
    23  second no more than nine digits long. You can combine the `--since` or `--until` 
    24  options with either or both of the `--follow` or `--tail` options.
    25  
    26  The `docker container logs --details` command will add on extra attributes, such as
    27  environment variables and labels, provided to `--log-opt` when creating the
    28  container.
    29  
    30  In order to retrieve logs before a specific point in time, run:
    31  
    32  ```bash
    33  $ docker run --name test -d busybox sh -c "while true; do $(echo date); sleep 1; done"
    34  $ date
    35  Tue 14 Nov 2017 16:40:00 CET
    36  $ docker logs -f --until=2s test
    37  Tue 14 Nov 2017 16:40:00 CET
    38  Tue 14 Nov 2017 16:40:01 CET
    39  Tue 14 Nov 2017 16:40:02 CET
    40  ```