{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/12726","labels_url":"https://api.github.com/repos/docker/docker/issues/12726/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/12726/comments","events_url":"https://api.github.com/repos/docker/docker/issues/12726/events","html_url":"https://github.com/docker/docker/pull/12726","id":70554652,"number":12726,"title":"Don't split log writes by line","user":{"login":"fw42","id":2072686,"avatar_url":"https://avatars.githubusercontent.com/u/2072686?v=3","gravatar_id":"","url":"https://api.github.com/users/fw42","html_url":"https://github.com/fw42","followers_url":"https://api.github.com/users/fw42/followers","following_url":"https://api.github.com/users/fw42/following{/other_user}","gists_url":"https://api.github.com/users/fw42/gists{/gist_id}","starred_url":"https://api.github.com/users/fw42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fw42/subscriptions","organizations_url":"https://api.github.com/users/fw42/orgs","repos_url":"https://api.github.com/users/fw42/repos","events_url":"https://api.github.com/users/fw42/events{/privacy}","received_events_url":"https://api.github.com/users/fw42/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/1-needs-design-review","name":"status/1-needs-design-review","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-24T01:11:29Z","updated_at":"2015-04-24T16:37:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/12726","html_url":"https://github.com/docker/docker/pull/12726","diff_url":"https://github.com/docker/docker/pull/12726.diff","patch_url":"https://github.com/docker/docker/pull/12726.patch"},"body":"I want to use this PR to discuss the current behaviour and suggest a different one.\r\n\r\nCurrently, if a Docker container logs a multi-line message in a single `write()` (e.g. `echo -en \"foo\\nbar\\n\"`), the copier splits those messages into lines, such that the log driver will receive one call to `Log()` per line (rather than one call to `Log()` per write that the container did). That behaviour somewhat breaks multi-line logging.\r\n\r\nFor a bit of context: We are playing around with implementing a Kafka logging driver for Docker (someone from the core team encouraged that and said other people might be interested) and we would like to send one Kafka message per \"log event\". Splitting the output of the container into lines would result in us sending multiple Kafka messages.\r\n\r\nThoughts?\r\n\r\n@LK4D4 @crosbymichael @sirupsen @graemej"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/95987194","html_url":"https://github.com/docker/docker/pull/12726#issuecomment-95987194","issue_url":"https://api.github.com/repos/docker/docker/issues/12726","id":95987194,"user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T16:37:11Z","updated_at":"2015-04-24T16:37:11Z","body":"There is no way to reliably detect multi-line messages. You're basically trying to convert a stream into datagrams.\r\nYou could try and implement this, but I think it'll cause more problems than it solves. People will constantly be complaining because it erroneously lumped multiple messages together, or split single messages apart."}}