mirror of https://github.com/docker/docs.git
Remove logdriver details for NATS (#2240)
The NATS driver was never integrated into Docker and should not be in the docs. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
a1ce533207
commit
dd0207cf47
|
@ -14,4 +14,3 @@ title: Logging drivers
|
|||
* [Splunk logging driver](splunk.md)
|
||||
* [ETW logging driver](etwlogs.md)
|
||||
* [Google Cloud Logging driver](gcplogs.md)
|
||||
* [NATS Logging driver](nats.md)
|
||||
|
|
|
@ -1,88 +0,0 @@
|
|||
---
|
||||
description: Describes how to use NATS for publishing log entries
|
||||
keywords: NATS, nats.io, messaging, docker, logging, driver
|
||||
title: NATS logging driver
|
||||
---
|
||||
|
||||
Docker logging driver for sending container the logs as events published to NATS in JSON format.
|
||||
|
||||
## Usage
|
||||
|
||||
You can configure the default logging driver by passing the `--log-driver`
|
||||
option to the Docker daemon:
|
||||
|
||||
```bash
|
||||
$ dockerd --log-driver=nats
|
||||
```
|
||||
|
||||
You can set the logging driver for a specific container by using the
|
||||
`--log-driver` option to `docker run`:
|
||||
|
||||
```bash
|
||||
$ docker run --log-driver=nats ...
|
||||
```
|
||||
|
||||
This log driver does not implement a reader so it is incompatible with `docker logs`.
|
||||
|
||||
## nats options
|
||||
|
||||
You can use the `--log-opt NAME=VALUE` flag to customize the logging driver
|
||||
for NATS:
|
||||
|
||||
| Option | Required | Description |
|
||||
|-----------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `labels` | optional | Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. |
|
||||
| `env` | optional | Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. |
|
||||
| `tag` | optional | Specify tag for message. Refer to the [log tag option documentation](log_tags.md) for customizing the log tag format. |
|
||||
| `nats-servers` | optional | NATS cluster nodes separated by commas. e.g. `nats://127.0.0.1:4222,nats://127.0.0.1:4223`. Defaults to `localhost:4222` |
|
||||
| `nats-max-reconnect` | optional | Maximum attempts that the driver will try to connect before giving up. Defaults to infinite (`-1`) |
|
||||
| `nats-subject` | optional | Specific subject to which logs will be published. Defaults to using `tag` if not specified |
|
||||
| `nats-user` | optional | Specify user in case of authentication required |
|
||||
| `nats-pass` | optional | Specify password in case of authentication required |
|
||||
| `nats-token` | optional | Specify token in case of authentication required |
|
||||
| `nats-tls-ca-cert` | optional | Specified the absolute path to the trust certificates signed by the CA |
|
||||
| `nats-tls-cert` | optional | Specifies the absolute path to the TLS certificate file |
|
||||
| `nats-tls-key` | optional | Specifies the absolute path to the TLS key file |
|
||||
| `nats-tls-skip-verify` | optional | Specifies whether to skip verification by setting it to `true` |
|
||||
|
||||
Below is an example usage of the driver for sending logs to a node in a
|
||||
NATS cluster to the `docker.logs` subject:
|
||||
|
||||
```bash
|
||||
$ docker run --log-driver=nats \
|
||||
--log-opt nats-subject=docker.logs \
|
||||
--log-opt nats-servers=nats://nats-node-1:4222,nats://nats-node-2:4222,nats://nats-node-3:4222 \
|
||||
your/application
|
||||
```
|
||||
|
||||
By default, the tag is used as the subject for NATS, so it has to be a valid
|
||||
subject in case subject it is left unspecified:
|
||||
|
||||
```bash
|
||||
{% raw %}
|
||||
$ docker run --log-driver nats \
|
||||
--log-opt tag="docker.{{.ID}}.{{.ImageName}}"
|
||||
your/application
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
Secure connection to NATS using TLS can be customized by setting `tls://` scheme
|
||||
in the URI and absolute paths to the certs and key files:
|
||||
|
||||
```bash
|
||||
docker run --log-driver nats \
|
||||
--log-opt nats-tls-key=/srv/configs/certs/client-key.pem \
|
||||
--log-opt nats-tls-cert=/srv/configs/certs/client-cert.pem \
|
||||
--log-opt nats-tls-ca-cert=/srv/configs/certs/ca.pem \
|
||||
--log-opt nats-servers="tls://127.0.0.1:4223,tls://127.0.0.1:4222" \
|
||||
your/application
|
||||
```
|
||||
|
||||
Skip verify is enabled by default, in order to deactivate we can specify `nats-tls-skip-verify`:
|
||||
|
||||
```bash
|
||||
docker run --log-driver nats \
|
||||
--log-opt nats-tls-skip-verify \
|
||||
--log-opt nats-servers="tls://127.0.0.1:4223,tls://127.0.0.1:4222" \
|
||||
your/application
|
||||
```
|
|
@ -69,7 +69,6 @@ for its configurable options, if applicable.
|
|||
| `splunk` | Writes log messages to `splunk` using the HTTP Event Collector.|
|
||||
| `etwlogs` | Writes log messages as Event Tracing for Windows (ETW) events. Only available on Windows platforms. |
|
||||
| `gcplogs` | Writes log messages to Google Cloud Platform (GCP) Logging. |
|
||||
| `nats` | NATS logging driver for Docker. Publishes log entries to a NATS server.|
|
||||
|
||||
## Limitations of logging drivers
|
||||
|
||||
|
@ -418,23 +417,3 @@ $ docker run --log-driver=gcplogs \
|
|||
|
||||
For detailed information about working with the Google Cloud logging driver, see
|
||||
the [Google Cloud Logging driver](gcplogs.md) reference documentation.
|
||||
|
||||
## NATS logging options
|
||||
|
||||
The NATS logging driver supports the following options:
|
||||
|
||||
```none
|
||||
--log-opt labels=<label1>,<label2>
|
||||
--log-opt env=<envvar1>,<envvar2>
|
||||
--log-opt tag=<tag>
|
||||
--log-opt nats-servers="<comma separated list of nats servers uris>"
|
||||
--log-opt nats-max-reconnect="<max attempts to connect to a server>"
|
||||
--log-opt nats-subject="<subject where logs are sent>"
|
||||
--log-opt nats-tls-ca-cert="<absolute path to cert>"
|
||||
--log-opt nats-tls-cert="<absolute path to cert>"
|
||||
--log-opt nats-tls-key="<absolute path to cert>"
|
||||
--log-opt nats-tls-skip-verify="<value>"
|
||||
```
|
||||
|
||||
For detailed information, see [the NATS logging driver](nats.md) reference
|
||||
documentation.
|
||||
|
|
Loading…
Reference in New Issue