mirror of https://github.com/docker/docs.git
Add syslog-tag option for syslog log-driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
bdb6fad34c
commit
a81af2e26a
|
@ -29,7 +29,10 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(ctx logger.Context) (logger.Logger, error) {
|
func New(ctx logger.Context) (logger.Logger, error) {
|
||||||
tag := ctx.ContainerID[:12]
|
tag := ctx.Config["syslog-tag"]
|
||||||
|
if tag == "" {
|
||||||
|
tag = ctx.ContainerID[:12]
|
||||||
|
}
|
||||||
|
|
||||||
proto, address, err := parseAddress(ctx.Config["syslog-address"])
|
proto, address, err := parseAddress(ctx.Config["syslog-address"])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -884,6 +884,7 @@ The following logging options are supported for this logging driver:
|
||||||
|
|
||||||
--log-opt address=[tcp|udp]://host:port
|
--log-opt address=[tcp|udp]://host:port
|
||||||
--log-opt address=unix://path
|
--log-opt address=unix://path
|
||||||
|
--log-opt syslog-tag="mailer"
|
||||||
|
|
||||||
`address` specifies the remote syslog server address where the driver connects to.
|
`address` specifies the remote syslog server address where the driver connects to.
|
||||||
If not specified it defaults to the local unix socket of the running system.
|
If not specified it defaults to the local unix socket of the running system.
|
||||||
|
@ -893,6 +894,8 @@ remote server at `192.168.0.42` on port `123`
|
||||||
|
|
||||||
$ docker run --log-driver=syslog --log-opt address=tcp://192.168.0.42:123
|
$ docker run --log-driver=syslog --log-opt address=tcp://192.168.0.42:123
|
||||||
|
|
||||||
|
`syslog-tag` specifies tag for syslog messages from container.
|
||||||
|
|
||||||
#### Logging driver: journald
|
#### Logging driver: journald
|
||||||
|
|
||||||
Journald logging driver for Docker. Writes log messages to journald; the container id will be stored in the journal's `CONTAINER_ID` field. `docker logs` command is not available for this logging driver. For detailed information on working with this logging driver, see [the journald logging driver](reference/logging/journald) reference documentation.
|
Journald logging driver for Docker. Writes log messages to journald; the container id will be stored in the journal's `CONTAINER_ID` field. `docker logs` command is not available for this logging driver. For detailed information on working with this logging driver, see [the journald logging driver](reference/logging/journald) reference documentation.
|
||||||
|
|
Loading…
Reference in New Issue