diff --git a/docs/reference/logging/fluentd.md b/docs/reference/logging/fluentd.md index 91b35a9062..5e9aaad4c2 100644 --- a/docs/reference/logging/fluentd.md +++ b/docs/reference/logging/fluentd.md @@ -75,21 +75,8 @@ the log tag format. ### labels and env -The `labels` and `env` options takes a comma-separated list of keys. If there is collision between `label` and `env` keys, the value of the `env` takes precedence. +The `labels` and `env` options each take a comma-separated list of keys. If there is collision between `label` and `env` keys, the value of the `env` takes precedence. Both options add additional fields to the extra attributes of a logging message. -To use attributes, specify them when you start the Docker daemon. - -``` -docker daemon --log-driver=fluentd --log-opt labels=foo --log-opt env=foo,fizz -``` - -Then, run a container and specify values for the `labels` or `env`. For example, you might use this: - -``` -docker run --label foo=bar -e fizz=buzz -d -P training/webapp python app.py -```` - -This adds additional fields to the extra attributes of a logging message. ## Fluentd daemon management with Docker @@ -110,7 +97,7 @@ aggregate store. @type forward - + @type stdout diff --git a/docs/reference/logging/journald.md b/docs/reference/logging/journald.md index 5d3d1c9153..c22ecdc343 100644 --- a/docs/reference/logging/journald.md +++ b/docs/reference/logging/journald.md @@ -43,23 +43,7 @@ journald logging driver options. ### labels and env -The `labels` and `env` options takes a comma-separated list of keys. If there is collision between `label` and `env` keys, the value of the `env` takes precedence. - -To use attributes, specify them when you start the Docker daemon. - -``` -docker daemon --log-driver=journald --log-opt labels=foo --log-opt env=foo,fizz -``` - -Then, run a container and specify values for the `labels` or `env`. For example, you might use this: - -``` -docker run --label foo=bar -e fizz=buzz -d -P training/webapp python app.py -```` - -This adds additional metadata in the journal with each message, one -for each key that matches. - +The `labels` and `env` options each take a comma-separated list of keys. If there is collision between `label` and `env` keys, the value of the `env` takes precedence. Both options add additional metadata in the journal with each message. ## Note regarding container names @@ -99,4 +83,3 @@ logs: for msg in reader: print '{CONTAINER_ID_FULL}: {MESSAGE}'.format(**msg) - diff --git a/docs/reference/logging/overview.md b/docs/reference/logging/overview.md index f76f7b7f8c..ad58474184 100644 --- a/docs/reference/logging/overview.md +++ b/docs/reference/logging/overview.md @@ -27,24 +27,7 @@ container's logging driver. The following options are supported: The `docker logs`command is available only for the `json-file` logging driver. - -## json-file options - -The following logging options are supported for the `json-file` logging driver: - - --log-opt max-size=[0-9+][k|m|g] - --log-opt max-file=[0-9+] - --log-opt labels=label1,label2 - --log-opt env=env1,env2 - -Logs that reach `max-size` are rolled over. You can set the size in kilobytes(k), megabytes(m), or gigabytes(g). eg `--log-opt max-size=50m`. If `max-size` is not set, then logs are not rolled over. - - -`max-file` specifies the maximum number of files that a log is rolled over before being discarded. eg `--log-opt max-file=100`. If `max-size` is not set, then `max-file` is not honored. - -If `max-size` and `max-file` are set, `docker logs` only returns the log lines from the newest log file. - -The `labels` and `env` options add additional attributes for use with logging drivers that accept them. Each of these options takes a comma-separated list of keys. If there is collision between `label` and `env` keys, the value of the `env` takes precedence. +The `labels` and `env` options add additional attributes for use with logging drivers that accept them. Each option takes a comma-separated list of keys. If there is collision between `label` and `env` keys, the value of the `env` takes precedence. To use attributes, specify them when you start the Docker daemon. @@ -58,12 +41,28 @@ Then, run a container and specify values for the `labels` or `env`. For example docker run --label foo=bar -e fizz=buzz -d -P training/webapp python app.py ```` -This adds additional fields depending on the driver, e.g. for +This adds additional fields to the log depending on the driver, e.g. for `json-file` that looks like: "attrs":{"fizz":"buzz","foo":"bar"} +## json-file options + +The following logging options are supported for the `json-file` logging driver: + + --log-opt max-size=[0-9+][k|m|g] + --log-opt max-file=[0-9+] + --log-opt labels=label1,label2 + --log-opt env=env1,env2 + +Logs that reach `max-size` are rolled over. You can set the size in kilobytes(k), megabytes(m), or gigabytes(g). eg `--log-opt max-size=50m`. If `max-size` is not set, then logs are not rolled over. + +`max-file` specifies the maximum number of files that a log is rolled over before being discarded. eg `--log-opt max-file=100`. If `max-size` is not set, then `max-file` is not honored. + +If `max-size` and `max-file` are set, `docker logs` only returns the log lines from the newest log file. + + ## syslog options The following logging options are supported for the `syslog` logging driver: