{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/20443","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/20443/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/20443/comments","events_url":"https://api.github.com/repos/docker/docker/issues/20443/events","html_url":"https://github.com/docker/docker/issues/20443","id":134608884,"number":20443,"title":"Journald logging does not accept the \"tag\" or \"syslog-tag\" options","user":{"login":"matthewdfuller","id":1226686,"avatar_url":"https://avatars.githubusercontent.com/u/1226686?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewdfuller","html_url":"https://github.com/matthewdfuller","followers_url":"https://api.github.com/users/matthewdfuller/followers","following_url":"https://api.github.com/users/matthewdfuller/following{/other_user}","gists_url":"https://api.github.com/users/matthewdfuller/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewdfuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewdfuller/subscriptions","organizations_url":"https://api.github.com/users/matthewdfuller/orgs","repos_url":"https://api.github.com/users/matthewdfuller/repos","events_url":"https://api.github.com/users/matthewdfuller/events{/privacy}","received_events_url":"https://api.github.com/users/matthewdfuller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-18T15:20:27Z","updated_at":"2016-02-18T15:20:27Z","closed_at":null,"body":"### Info:\r\n* `docker version`: 1.9.1\r\n* Host: CoreOS\r\n* Infrastructure: AWS\r\n\r\n### Problem Summary:\r\nUsing the journald log driver does not allow the use of tags in the log lines, seemingly contrary to the code comments and docs.\r\n\r\n### Steps to Reproduce\r\n1. Run a container with the syslog driver and the tags option:\r\n    \r\n    `docker run --log-driver=syslog --log-opt tag=\"{{.ImageName}}/{{.Name}}/{{.ID}}\" --name ...`\r\n2. Observe the logs using journalctl: `journalctl CONTAINER_NAME=name` and see that the lines are in the format: `image name/name/id log message`\r\n3. Run the same command but using the journald driver:\r\n\r\n    `docker run --log-driver=journald --log-opt tag=\"{{.ImageName}}/{{.Name}}/{{.ID}}\" --name ...`\r\n4. Observe error message:\r\n\r\n    `Error response from daemon: Cannot start container abc123...: Failed to initialize logging driver: unknown log opt 'tag' for journald log driver`\r\n5. Attempt to use `syslog-tag` instead and observe the same error:\r\n\r\n    `docker run --log-driver=journald --log-opt syslog-tag=\"{{.ImageName}}/{{.Name}}/{{.ID}}\" --name ...`\r\n6. Attempt to use a journald equivalent and observe the same error:\r\n\r\n    `docker run --log-driver=journald --log-opt journald-tag=\"{{.ImageName}}/{{.Name}}/{{.ID}}\" --name ...`\r\n\r\n### More Details\r\nAccording to the [release notes for version 1.9.0](https://github.com/docker/docker/blob/v1.9.0/CHANGELOG.md#logging), a standard \"--tag\" option was added to work generically across log drivers. The setup and usage for this is described in [PR #15384](https://github.com/docker/docker/pull/15384). This is specifically related to the fact that the journald logging driver doesn't print the tags in its log lines the same way that syslog and other drivers do. There are a [few issues](https://github.com/docker/docker/issues/16446) referencing the support of labels and custom fields, but they have been closed. Additionally, [according to this comment in the source code](https://github.com/docker/docker/blob/master/daemon/logger/journald/journald.go#L78), journald should accept the `tag` argument.\r\n\r\nEssentially, I need to be able to print, using the journald driver, the following line:\r\n\r\n`Feb 17 18:53:32 ip-1-2-3-4.ec2.internal docker/containername/container/id [26356]: ::1 - - log line info`\r\n\r\nusing the built in: `{{.ImageName}}/{{.Name}}/{{.ID}}` tag templates."}}