Skip to content

Commit

Permalink
Merge pull request moby#13672 from LK4D4/syslog_tag
Browse files Browse the repository at this point in the history
Add syslog-tag option
  • Loading branch information
thaJeztah committed Jun 3, 2015
2 parents 641f3e0 + 3df1974 commit 0636bb7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 4 additions & 1 deletion daemon/logger/syslog/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ func init() {
}

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"])
if err != nil {
Expand Down
17 changes: 12 additions & 5 deletions docs/sources/reference/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -882,20 +882,27 @@ command is not available for this logging driver

The following logging options are supported for this logging driver:

--log-opt address=[tcp|udp]://host:port
--log-opt address=unix://path
--log-opt syslog-address=[tcp|udp]://host:port
--log-opt syslog-address=unix://path
--log-opt syslog-tag="mailer"

`address` specifies the remote syslog server address where the driver connects to.
`syslog-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 transport is either `tcp` or `udp` and `port` is not specified it defaults to `514`
The following example shows how to have the `syslog` driver connect to a `syslog`
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 syslog-address=tcp://192.168.0.42:123

`syslog-tag` specifies tag for syslog messages from container.

#### 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.

The following logging options are supported for this logging driver: [none]

Expand Down

0 comments on commit 0636bb7

Please sign in to comment.