{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/16386","labels_url":"https://api.github.com/repos/docker/docker/issues/16386/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/16386/comments","events_url":"https://api.github.com/repos/docker/docker/issues/16386/events","html_url":"https://github.com/docker/docker/issues/16386","id":107116056,"number":16386,"title":"Incorrect stream value in log statements from json-file logging driver","user":{"login":"yoanisgil","id":918271,"avatar_url":"https://avatars.githubusercontent.com/u/918271?v=3","gravatar_id":"","url":"https://api.github.com/users/yoanisgil","html_url":"https://github.com/yoanisgil","followers_url":"https://api.github.com/users/yoanisgil/followers","following_url":"https://api.github.com/users/yoanisgil/following{/other_user}","gists_url":"https://api.github.com/users/yoanisgil/gists{/gist_id}","starred_url":"https://api.github.com/users/yoanisgil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoanisgil/subscriptions","organizations_url":"https://api.github.com/users/yoanisgil/orgs","repos_url":"https://api.github.com/users/yoanisgil/repos","events_url":"https://api.github.com/users/yoanisgil/events{/privacy}","received_events_url":"https://api.github.com/users/yoanisgil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-18T02:14:51Z","updated_at":"2015-09-18T02:14:51Z","closed_at":null,"body":"A couple of days ago I wrote an article on Docker and the json-file and syslog driver (see [here](https://medium.com/@yoanis_gil/logging-with-docker-part-1-b23ef1443aac)) and some of the readers brought to my attention an issue which I find slightly disturbing. The demo is quite simple indeed (source https://github.com/yoanisgil/docker-logging-tutorial/blob/master/part-01/logging-01.py):\r\n\r\n```python\r\nimport sys\r\nimport time\r\nwhile True:\r\n    sys.stderr.write('Error\\n')\r\n    sys.stdout.write('All Good\\n')\r\n    time.sleep(1)\r\n``` \r\n\r\nand then run:\r\n\r\n```\r\ndocker run --name logging-01 -t -d -v $(pwd):/tmp  -w /tmp python:2.7 python logging-01.py\r\n```\r\n\r\nwhich outputs :\r\n\r\n```\r\nError\r\nAll Good\r\n....\r\n```\r\nhowever when I check the json file where log messages are kept, I see this:\r\n\r\n```\r\n{\"log\":\"Error\\r\\n\",\"stream\":\"stdout\",\"time\":\"2015-09-18T01:44:29.361979588Z\"}\r\n{\"log\":\"All Good\\r\\n\",\"stream\":\"stdout\",\"time\":\"2015-09-18T01:44:29.36244363Z\"}\r\n```\r\n\r\nand what I find disturbing and, so those the reader, is that for the \"Error\" entry the `stream` field is set to  `stdout`. Shouldn't that be `stderr`. Is this an expected behaviour? Notice that the \"Error\" string is written with:\r\n\r\n```\r\nsys.stderr.write('Error\\n')\r\n```\r\n\r\nMaybe I a missing something obvious here but if I am I'd love to know what am I doing wrong."}}