mirror of https://github.com/docker/cli.git
Merge pull request #5438 from thaJeztah/dockerd_logformat
docs, man: dockerd: add documentation for "--log-format" option
This commit is contained in:
commit
ccc87eb6ab
|
@ -80,6 +80,7 @@ Options:
|
||||||
--label list Set key=value labels to the daemon
|
--label list Set key=value labels to the daemon
|
||||||
--live-restore Enable live restore of docker when containers are still running
|
--live-restore Enable live restore of docker when containers are still running
|
||||||
--log-driver string Default driver for container logs (default "json-file")
|
--log-driver string Default driver for container logs (default "json-file")
|
||||||
|
--log-format string Set the logging format ("text"|"json") (default "text")
|
||||||
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
|
-l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
|
||||||
--log-opt map Default log driver options for containers (default map[])
|
--log-opt map Default log driver options for containers (default map[])
|
||||||
--max-concurrent-downloads int Set the max concurrent downloads (default 3)
|
--max-concurrent-downloads int Set the max concurrent downloads (default 3)
|
||||||
|
@ -891,6 +892,33 @@ Alternatively, you can set custom locations for CDI specifications using the
|
||||||
When CDI is enabled for a daemon, you can view the configured CDI specification
|
When CDI is enabled for a daemon, you can view the configured CDI specification
|
||||||
directories using the `docker info` command.
|
directories using the `docker info` command.
|
||||||
|
|
||||||
|
#### <a name="log-format"></a> Daemon logging format
|
||||||
|
|
||||||
|
The `--log-format` option or "log-format" option in the [daemon configuration file](#daemon-configuration-file)
|
||||||
|
lets you set the format for logs produced by the daemon. The logging format should
|
||||||
|
only be configured either through the `--log-format` command line option or
|
||||||
|
through the "log-format" field in the configuration file; using both
|
||||||
|
the command-line option and the "log-format" field in the configuration
|
||||||
|
file produces an error. If this option is not set, the default is "text".
|
||||||
|
|
||||||
|
The following example configures the daemon through the `--log-format` command
|
||||||
|
line option to use `json` formatted logs;
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ dockerd --log-format=json
|
||||||
|
# ...
|
||||||
|
{"level":"info","msg":"API listen on /var/run/docker.sock","time":"2024-09-16T11:06:08.558145428Z"}
|
||||||
|
```
|
||||||
|
|
||||||
|
The following example shows a `daemon.json` configuration file with the
|
||||||
|
"log-format" set;
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"log-format": "json"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Miscellaneous options
|
### Miscellaneous options
|
||||||
|
|
||||||
IP masquerading uses address translation to allow containers without a public
|
IP masquerading uses address translation to allow containers without a public
|
||||||
|
@ -1123,6 +1151,7 @@ The following is a full example of the allowed configuration options on Linux:
|
||||||
"labels": [],
|
"labels": [],
|
||||||
"live-restore": true,
|
"live-restore": true,
|
||||||
"log-driver": "json-file",
|
"log-driver": "json-file",
|
||||||
|
"log-format": "text",
|
||||||
"log-level": "",
|
"log-level": "",
|
||||||
"log-opts": {
|
"log-opts": {
|
||||||
"cache-disabled": "false",
|
"cache-disabled": "false",
|
||||||
|
@ -1217,6 +1246,7 @@ The following is a full example of the allowed configuration options on Windows:
|
||||||
"insecure-registries": [],
|
"insecure-registries": [],
|
||||||
"labels": [],
|
"labels": [],
|
||||||
"log-driver": "",
|
"log-driver": "",
|
||||||
|
"log-format": "text",
|
||||||
"log-level": "",
|
"log-level": "",
|
||||||
"max-concurrent-downloads": 3,
|
"max-concurrent-downloads": 3,
|
||||||
"max-concurrent-uploads": 5,
|
"max-concurrent-uploads": 5,
|
||||||
|
|
|
@ -53,6 +53,7 @@ dockerd - Enable daemon mode
|
||||||
[**--label**[=*[]*]]
|
[**--label**[=*[]*]]
|
||||||
[**--live-restore**[=**false**]]
|
[**--live-restore**[=**false**]]
|
||||||
[**--log-driver**[=*json-file*]]
|
[**--log-driver**[=*json-file*]]
|
||||||
|
[**--log-format**="*text*|*json*"]
|
||||||
[**--log-opt**[=*map[]*]]
|
[**--log-opt**[=*map[]*]]
|
||||||
[**--mtu**[=*0*]]
|
[**--mtu**[=*0*]]
|
||||||
[**--max-concurrent-downloads**[=*3*]]
|
[**--max-concurrent-downloads**[=*3*]]
|
||||||
|
@ -333,6 +334,9 @@ unix://[/path/to/socket] to use.
|
||||||
Default driver for container logs. Default is **json-file**.
|
Default driver for container logs. Default is **json-file**.
|
||||||
**Warning**: **docker logs** command works only for **json-file** logging driver.
|
**Warning**: **docker logs** command works only for **json-file** logging driver.
|
||||||
|
|
||||||
|
**--log-format**="*text*|*json*"
|
||||||
|
Set the format for logs produced by the daemon. Default is "text".
|
||||||
|
|
||||||
**--log-opt**=[]
|
**--log-opt**=[]
|
||||||
Logging driver specific options.
|
Logging driver specific options.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue