1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/container
Yong Tang 38c49d9987 Remove docker/ prefix from log messages tag.
This fix tries to address the issue raised in #22358 where syslog's
message tag always starts with `docker/` and can not be removed
by changing the log tag templates.

The issue is that syslog driver hardcodes `path.Base(os.Args[0])`
as the prefix, which is the binary file name of the daemon (`dockerd`).
This could be an issue for certain situations (e.g., #22358) where
user may prefer not to have a dedicated prefix in syslog messages.
There is no way to override this behavior in the current verison of
the docker.

This fix tries to address this issue without making changes in the
default behavior of the syslog driver. An additional
`{{.DaemonName}}` has been introduced in the syslog tag. This is
assigned as the `docker` when daemon starts. The default log tag
template has also been changed from
`path.Base(os.Args[0]) + "/{{.ID}}"` to `{{.DaemonName}}/{{.ID}}`.
Therefore, there is no behavior changes when log-tag is not provided.

In order to be consistent, the default log tag for fluentd has been
changed from `docker.{{.ID}}` to `{{DaemonName}}.{{.ID}}` as well.

The documentation for log-tag has been updated to reflect this change.

Additional test cases have been added to cover changes in this fix.

This fix fixes #22358.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-12 22:29:30 -07:00
..
archive.go Windows: docker cp consistent paths 2016-05-06 16:08:53 -07:00
container.go Remove docker/ prefix from log messages tag. 2016-05-12 22:29:30 -07:00
container_unit_test.go Modify import paths to point to the new engine-api package. 2016-01-06 19:48:59 -05:00
container_unix.go When calling volume driver Mount, send opaque ID 2016-04-29 09:37:02 -04:00
container_windows.go Windows: Support ARG in builder 2016-05-04 14:32:23 -07:00
history.go Extract container store from the daemon. 2016-01-19 13:21:41 -05:00
memory_store.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
memory_store_test.go Extract container store from the daemon. 2016-01-19 13:21:41 -05:00
monitor.go daemon: remove some unused code 2016-03-31 11:24:12 -07:00
mounts_unix.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
mounts_windows.go Windows libcontainerd implementation 2016-03-18 13:38:41 -07:00
state.go Remove WaitRunning 2016-04-27 11:36:47 +08:00
state_test.go Remove WaitRunning 2016-04-27 11:36:47 +08:00
state_unix.go Replace execdrivers with containerd implementation 2016-03-18 13:38:32 -07:00
state_windows.go Windows libcontainerd implementation 2016-03-18 13:38:41 -07:00
store.go Extract container store from the daemon. 2016-01-19 13:21:41 -05:00