Skip to content

Commit 7f1806b

Browse files
committed
docs: container logs: add headers for flags
Add separate headers for each flag, so that they can be linked from the flag-description table. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent f3f823c commit 7f1806b

2 files changed

Lines changed: 33 additions & 21 deletions

File tree

docs/reference/commandline/container_logs.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ Fetch the logs of a container
99

1010
### Options
1111

12-
| Name | Type | Default | Description |
13-
|:---------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------|
14-
| `--details` | `bool` | | Show extra details provided to logs |
15-
| `-f`, `--follow` | `bool` | | Follow log output |
16-
| `--since` | `string` | | Show logs since timestamp (e.g. `2013-01-02T13:23:37Z`) or relative (e.g. `42m` for 42 minutes) |
17-
| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs |
18-
| `-t`, `--timestamps` | `bool` | | Show timestamps |
19-
| [`--until`](#until) | `string` | | Show logs before a timestamp (e.g. `2013-01-02T13:23:37Z`) or relative (e.g. `42m` for 42 minutes) |
12+
| Name | Type | Default | Description |
13+
|:---------------------------------------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------|
14+
| [`--details`](#details) | `bool` | | Show extra details provided to logs |
15+
| [`-f`](#follow), [`--follow`](#follow) | `bool` | | Follow log output |
16+
| [`--since`](#since) | `string` | | Show logs since timestamp (e.g. `2013-01-02T13:23:37Z`) or relative (e.g. `42m` for 42 minutes) |
17+
| [`-n`](#tail), [`--tail`](#tail) | `string` | `all` | Number of lines to show from the end of the logs |
18+
| [`-t`](#timestamps), [`--timestamps`](#timestamps) | `bool` | | Show timestamps |
19+
| [`--until`](#until) | `string` | | Show logs before a timestamp (e.g. `2013-01-02T13:23:37Z`) or relative (e.g. `42m` for 42 minutes) |
2020

2121

2222
<!---MARKER_GEN_END-->
@@ -28,21 +28,34 @@ The `docker logs` command batch-retrieves logs present at the time of execution.
2828
For more information about selecting and configuring logging drivers, refer to
2929
[Configure logging drivers](https://docs.docker.com/engine/logging/configure/).
3030

31+
## Examples
32+
33+
### <a name="follow"></a> Stream log output (-f, --follow)
34+
3135
The `docker logs --follow` command will continue streaming the new output from
3236
the container's `STDOUT` and `STDERR`.
3337

38+
### <a name="tail"></a> Retrieve the last logs (-n, --tail)
39+
3440
Passing a negative number or a non-integer to `--tail` is invalid and the
3541
value is set to `all` in that case.
3642

43+
44+
### <a name="timestamps"></a> Retrieve logs with timestamps (-t, --timestamps)
45+
3746
The `docker logs --timestamps` command will add an [RFC3339Nano timestamp](https://pkg.go.dev/time#RFC3339Nano)
3847
, for example `2014-09-16T06:17:46.000000000Z`, to each
3948
log entry. To ensure that the timestamps are aligned the
4049
nano-second part of the timestamp will be padded with zero when necessary.
4150

51+
### <a name="details"></a> Retrieve logs with additional attributes (--details)
52+
4253
The `docker logs --details` command will add on extra attributes, such as
4354
environment variables and labels, provided to `--log-opt` when creating the
4455
container.
4556

57+
### <a name="since"></a> Retrieve logs generated since a specific point in time (--since)
58+
4659
The `--since` option shows only the container logs generated after
4760
a given date. You can specify the date as an RFC 3339 date, a UNIX
4861
timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Besides RFC3339 date
@@ -56,7 +69,6 @@ seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
5669
fraction of a second no more than nine digits long. You can combine the
5770
`--since` option with either or both of the `--follow` or `--tail` options.
5871

59-
## Examples
6072

6173
### <a name="until"></a> Retrieve logs until a specific point in time (--until)
6274

docs/reference/commandline/docker.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ The base command for the Docker CLI.
6868

6969
### Options
7070

71-
| Name | Type | Default | Description |
72-
|:---------------------------------|:---------|:-------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
73-
| `--config` | `string` | `/root/.docker` | Location of client config files |
74-
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
75-
| `-D`, `--debug` | `bool` | | Enable debug mode |
76-
| [`-H`](#host), [`--host`](#host) | `string` | | Daemon socket to connect to |
77-
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
78-
| `--tls` | `bool` | | Use TLS; implied by --tlsverify |
79-
| `--tlscacert` | `string` | `/root/.docker/ca.pem` | Trust certs signed only by this CA |
80-
| `--tlscert` | `string` | `/root/.docker/cert.pem` | Path to TLS certificate file |
81-
| `--tlskey` | `string` | `/root/.docker/key.pem` | Path to TLS key file |
82-
| `--tlsverify` | `bool` | | Use TLS and verify the remote |
71+
| Name | Type | Default | Description |
72+
|:---------------------------------|:---------|:------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------|
73+
| `--config` | `string` | `/Users/thajeztah/.docker` | Location of client config files |
74+
| `-c`, `--context` | `string` | | Name of the context to use to connect to the daemon (overrides DOCKER_HOST env var and default context set with `docker context use`) |
75+
| `-D`, `--debug` | `bool` | | Enable debug mode |
76+
| [`-H`](#host), [`--host`](#host) | `string` | | Daemon socket to connect to |
77+
| `-l`, `--log-level` | `string` | `info` | Set the logging level (`debug`, `info`, `warn`, `error`, `fatal`) |
78+
| `--tls` | `bool` | | Use TLS; implied by --tlsverify |
79+
| `--tlscacert` | `string` | `/Users/thajeztah/.docker/ca.pem` | Trust certs signed only by this CA |
80+
| `--tlscert` | `string` | `/Users/thajeztah/.docker/cert.pem` | Path to TLS certificate file |
81+
| `--tlskey` | `string` | `/Users/thajeztah/.docker/key.pem` | Path to TLS key file |
82+
| `--tlsverify` | `bool` | | Use TLS and verify the remote |
8383

8484

8585
<!---MARKER_GEN_END-->

0 commit comments

Comments
 (0)