{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/30096089","id":30096089,"diff_hunk":"@@ -13,20 +16,50 @@ import (\n // JSONFileLogger is Logger implementation for default docker logging:\n // JSON objects to file\n type JSONFileLogger struct {\n-\tbuf *bytes.Buffer\n-\tf   *os.File   // store for closing\n-\tmu  sync.Mutex // protects buffer\n+\tbuf      *bytes.Buffer\n+\tf        *os.File // store for closing\n+\tcapacity int64\n+\tmu       sync.Mutex // protects buffer\n+\tn        int\n }\n \n-// New creates new JSONFileLogger which writes to filename\n-func New(filename string) (logger.Logger, error) {\n-\tlog, err := os.OpenFile(filename, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0600)\n+func New(filename string, capacity string, n int) (logger.Logger, error) {\n+\tvar capVal int64\n+\tif capacity != \"\" {\n+\t\tvar multiplier int64\n+\t\tcapString := capacity[:len(capacity)-1]\n+\t\tswitch strings.ToLower(capacity[len(capacity)-1:]) {","path":"daemon/logger/jsonfilelog/jsonfilelog.go","position":33,"original_position":33,"commit_id":"1c1812493d780368e1f0077afc6f801abf9714f0","original_commit_id":"1c1812493d780368e1f0077afc6f801abf9714f0","user":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"body":"Is there a reason why you cannot use `pkg/units` ?","created_at":"2015-05-12T00:33:54Z","updated_at":"2015-05-12T00:33:54Z","html_url":"https://github.com/docker/docker/pull/11485#discussion_r30096089","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/11485","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/30096089"},"html":{"href":"https://github.com/docker/docker/pull/11485#discussion_r30096089"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/11485"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/11485","id":31487039,"html_url":"https://github.com/docker/docker/pull/11485","diff_url":"https://github.com/docker/docker/pull/11485.diff","patch_url":"https://github.com/docker/docker/pull/11485.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/11485","number":11485,"state":"open","locked":false,"title":"Add rollover log driver, and --log-driver-opts flag","user":{"login":"wlan0","id":1050521,"avatar_url":"https://avatars.githubusercontent.com/u/1050521?v=3","gravatar_id":"","url":"https://api.github.com/users/wlan0","html_url":"https://github.com/wlan0","followers_url":"https://api.github.com/users/wlan0/followers","following_url":"https://api.github.com/users/wlan0/following{/other_user}","gists_url":"https://api.github.com/users/wlan0/gists{/gist_id}","starred_url":"https://api.github.com/users/wlan0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlan0/subscriptions","organizations_url":"https://api.github.com/users/wlan0/orgs","repos_url":"https://api.github.com/users/wlan0/repos","events_url":"https://api.github.com/users/wlan0/events{/privacy}","received_events_url":"https://api.github.com/users/wlan0/received_events","type":"User","site_admin":false},"body":"Closes #8911\r\n\r\nThis adds log rollover capability to docker. I have added a new driver called `rollover` for this.\r\n\r\nThere are two options that can be specified along with this option. In order to specify these options, I added a new flag called `--log-driver-opts`. That would allow one to specify options like this\r\n\r\n`docker run --logging-driver rollover --log-driver-opts max_size=1k --log-driver-opts file_count=10`","created_at":"2015-03-19T00:54:37Z","updated_at":"2015-05-12T00:33:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c794168f168a266080bbf24bc12e6e65052d769","assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/38","html_url":"https://github.com/docker/docker/milestones/1.7.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/38/labels","id":1010239,"number":38,"title":"1.7.0","description":"","creator":{"login":"dmcgowan","id":169601,"avatar_url":"https://avatars.githubusercontent.com/u/169601?v=3","gravatar_id":"","url":"https://api.github.com/users/dmcgowan","html_url":"https://github.com/dmcgowan","followers_url":"https://api.github.com/users/dmcgowan/followers","following_url":"https://api.github.com/users/dmcgowan/following{/other_user}","gists_url":"https://api.github.com/users/dmcgowan/gists{/gist_id}","starred_url":"https://api.github.com/users/dmcgowan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmcgowan/subscriptions","organizations_url":"https://api.github.com/users/dmcgowan/orgs","repos_url":"https://api.github.com/users/dmcgowan/repos","events_url":"https://api.github.com/users/dmcgowan/events{/privacy}","received_events_url":"https://api.github.com/users/dmcgowan/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":15,"state":"open","created_at":"2015-03-07T01:54:49Z","updated_at":"2015-05-12T00:06:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/11485/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/11485/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/11485/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/1c1812493d780368e1f0077afc6f801abf9714f0","head":{"label":"wlan0:rollover_log","ref":"rollover_log","sha":"1c1812493d780368e1f0077afc6f801abf9714f0","user":{"login":"wlan0","id":1050521,"avatar_url":"https://avatars.githubusercontent.com/u/1050521?v=3","gravatar_id":"","url":"https://api.github.com/users/wlan0","html_url":"https://github.com/wlan0","followers_url":"https://api.github.com/users/wlan0/followers","following_url":"https://api.github.com/users/wlan0/following{/other_user}","gists_url":"https://api.github.com/users/wlan0/gists{/gist_id}","starred_url":"https://api.github.com/users/wlan0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlan0/subscriptions","organizations_url":"https://api.github.com/users/wlan0/orgs","repos_url":"https://api.github.com/users/wlan0/repos","events_url":"https://api.github.com/users/wlan0/events{/privacy}","received_events_url":"https://api.github.com/users/wlan0/received_events","type":"User","site_admin":false},"repo":{"id":31682821,"name":"docker","full_name":"wlan0/docker","owner":{"login":"wlan0","id":1050521,"avatar_url":"https://avatars.githubusercontent.com/u/1050521?v=3","gravatar_id":"","url":"https://api.github.com/users/wlan0","html_url":"https://github.com/wlan0","followers_url":"https://api.github.com/users/wlan0/followers","following_url":"https://api.github.com/users/wlan0/following{/other_user}","gists_url":"https://api.github.com/users/wlan0/gists{/gist_id}","starred_url":"https://api.github.com/users/wlan0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wlan0/subscriptions","organizations_url":"https://api.github.com/users/wlan0/orgs","repos_url":"https://api.github.com/users/wlan0/repos","events_url":"https://api.github.com/users/wlan0/events{/privacy}","received_events_url":"https://api.github.com/users/wlan0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wlan0/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/wlan0/docker","forks_url":"https://api.github.com/repos/wlan0/docker/forks","keys_url":"https://api.github.com/repos/wlan0/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wlan0/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wlan0/docker/teams","hooks_url":"https://api.github.com/repos/wlan0/docker/hooks","issue_events_url":"https://api.github.com/repos/wlan0/docker/issues/events{/number}","events_url":"https://api.github.com/repos/wlan0/docker/events","assignees_url":"https://api.github.com/repos/wlan0/docker/assignees{/user}","branches_url":"https://api.github.com/repos/wlan0/docker/branches{/branch}","tags_url":"https://api.github.com/repos/wlan0/docker/tags","blobs_url":"https://api.github.com/repos/wlan0/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wlan0/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wlan0/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/wlan0/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wlan0/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/wlan0/docker/languages","stargazers_url":"https://api.github.com/repos/wlan0/docker/stargazers","contributors_url":"https://api.github.com/repos/wlan0/docker/contributors","subscribers_url":"https://api.github.com/repos/wlan0/docker/subscribers","subscription_url":"https://api.github.com/repos/wlan0/docker/subscription","commits_url":"https://api.github.com/repos/wlan0/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/wlan0/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/wlan0/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/wlan0/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/wlan0/docker/contents/{+path}","compare_url":"https://api.github.com/repos/wlan0/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wlan0/docker/merges","archive_url":"https://api.github.com/repos/wlan0/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wlan0/docker/downloads","issues_url":"https://api.github.com/repos/wlan0/docker/issues{/number}","pulls_url":"https://api.github.com/repos/wlan0/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/wlan0/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/wlan0/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wlan0/docker/labels{/name}","releases_url":"https://api.github.com/repos/wlan0/docker/releases{/id}","created_at":"2015-03-04T22:15:59Z","updated_at":"2015-04-15T23:49:20Z","pushed_at":"2015-05-11T23:40:27Z","git_url":"git://github.com/wlan0/docker.git","ssh_url":"git@github.com:wlan0/docker.git","clone_url":"https://github.com/wlan0/docker.git","svn_url":"https://github.com/wlan0/docker","homepage":"http://www.docker.com","size":53929,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"c49695f976ab97dc8c7a249f5211d9e0fcb2c24c","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-05-11T22:07:22Z","pushed_at":"2015-05-12T00:15:30Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":201769,"stargazers_count":21542,"watchers_count":21542,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5050,"mirror_url":null,"open_issues_count":968,"forks":5050,"open_issues":968,"watchers":21542,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/11485"},"html":{"href":"https://github.com/docker/docker/pull/11485"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/11485"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/11485/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/11485/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/11485/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/1c1812493d780368e1f0077afc6f801abf9714f0"}}}}