{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/comments/188259322","pull_request_review_id":120196108,"id":188259322,"diff_hunk":"@@ -0,0 +1,33 @@\n+package com.gu.logback.appender.kinesis;\n+\n+import ch.qos.logback.core.spi.DeferredProcessingAware;\n+\n+import java.util.Iterator;\n+import java.util.Map;\n+import javax.json.*;\n+\n+public class JsonKinesisAppender <Event extends DeferredProcessingAware>\n+        extends KinesisAppender<Event> {\n+\n+    public JsonKinesisAppender(Map<String, String> standardTags) {\n+        super();\n+        this.standardTags = standardTags;\n+    }\n+\n+    private Map<String, String> standardTags;\n+\n+    @Override\n+    protected void putMessage(String message) throws Exception {\n+        // build a json object\n+        JsonObjectBuilder json = Json.createObjectBuilder();\n+        Iterator i = standardTags.keySet().iterator();\n+        while (i.hasNext()) {\n+            String k = (String) i.next();\n+            String v = standardTags.get(k);\n+            json.add(k, v);\n+        }\n+        json.add(\"message\", message);\n+        super.putMessage(json.build().toString());\n+    }\n+\n+}","path":"src/main/java/com/gu/logback/appender/kinesis/JsonKinesisAppender.java","position":33,"original_position":33,"commit_id":"fea14cc5f17694f4bc8a65c30dbd1e39e682be5e","original_commit_id":"fea14cc5f17694f4bc8a65c30dbd1e39e682be5e","user":{"login":"sihil","id":1236466,"avatar_url":"https://avatars2.githubusercontent.com/u/1236466?v=4","gravatar_id":"","url":"https://api.github.com/users/sihil","html_url":"https://github.com/sihil","followers_url":"https://api.github.com/users/sihil/followers","following_url":"https://api.github.com/users/sihil/following{/other_user}","gists_url":"https://api.github.com/users/sihil/gists{/gist_id}","starred_url":"https://api.github.com/users/sihil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sihil/subscriptions","organizations_url":"https://api.github.com/users/sihil/orgs","repos_url":"https://api.github.com/users/sihil/repos","events_url":"https://api.github.com/users/sihil/events{/privacy}","received_events_url":"https://api.github.com/users/sihil/received_events","type":"User","site_admin":false},"body":"This seems to limit you to ssa plus message as fields? We've generally used it in conjunction with `LogstashLayout` from [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder) which lets you add extra key-value pairs at the point of logging and deals with the JSON formatting for you. Is that too heavyweight?","created_at":"2018-05-15T11:57:55Z","updated_at":"2018-05-15T11:58:54Z","html_url":"https://github.com/guardian/kinesis-logback-appender/pull/25#discussion_r188259322","pull_request_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/comments/188259322"},"html":{"href":"https://github.com/guardian/kinesis-logback-appender/pull/25#discussion_r188259322"},"pull_request":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25","id":188093683,"html_url":"https://github.com/guardian/kinesis-logback-appender/pull/25","diff_url":"https://github.com/guardian/kinesis-logback-appender/pull/25.diff","patch_url":"https://github.com/guardian/kinesis-logback-appender/pull/25.patch","issue_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/25","number":25,"state":"open","locked":false,"title":"Create JsonKinesisAppender","user":{"login":"aug24","id":5476326,"avatar_url":"https://avatars3.githubusercontent.com/u/5476326?v=4","gravatar_id":"","url":"https://api.github.com/users/aug24","html_url":"https://github.com/aug24","followers_url":"https://api.github.com/users/aug24/followers","following_url":"https://api.github.com/users/aug24/following{/other_user}","gists_url":"https://api.github.com/users/aug24/gists{/gist_id}","starred_url":"https://api.github.com/users/aug24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aug24/subscriptions","organizations_url":"https://api.github.com/users/aug24/orgs","repos_url":"https://api.github.com/users/aug24/repos","events_url":"https://api.github.com/users/aug24/events{/privacy}","received_events_url":"https://api.github.com/users/aug24/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-15T11:15:45Z","updated_at":"2018-05-15T11:58:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c5baf50a7a41920fc810db17ceb3120f23cd433","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25/commits","review_comments_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25/comments","review_comment_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/25/comments","statuses_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/statuses/fea14cc5f17694f4bc8a65c30dbd1e39e682be5e","head":{"label":"guardian:jr/create-json-kinesis-appender","ref":"jr/create-json-kinesis-appender","sha":"fea14cc5f17694f4bc8a65c30dbd1e39e682be5e","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":40535628,"name":"kinesis-logback-appender","full_name":"guardian/kinesis-logback-appender","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/kinesis-logback-appender","description":"LOGBack Appender for writing data into a Kinesis Stream","fork":false,"url":"https://api.github.com/repos/guardian/kinesis-logback-appender","forks_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/forks","keys_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/teams","hooks_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/hooks","issue_events_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/events","assignees_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/tags","blobs_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/languages","stargazers_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/stargazers","contributors_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/contributors","subscribers_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/subscribers","subscription_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/subscription","commits_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/merges","archive_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/downloads","issues_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/labels{/name}","releases_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/deployments","created_at":"2015-08-11T10:20:55Z","updated_at":"2018-05-11T09:53:07Z","pushed_at":"2018-05-15T11:15:45Z","git_url":"git://github.com/guardian/kinesis-logback-appender.git","ssh_url":"git@github.com:guardian/kinesis-logback-appender.git","clone_url":"https://github.com/guardian/kinesis-logback-appender.git","svn_url":"https://github.com/guardian/kinesis-logback-appender","homepage":null,"size":65,"stargazers_count":22,"watchers_count":22,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":17,"open_issues":12,"watchers":22,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"db012644c48ce879856fa35737b58e4c2128a71a","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":40535628,"name":"kinesis-logback-appender","full_name":"guardian/kinesis-logback-appender","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars0.githubusercontent.com/u/164318?v=4","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/kinesis-logback-appender","description":"LOGBack Appender for writing data into a Kinesis Stream","fork":false,"url":"https://api.github.com/repos/guardian/kinesis-logback-appender","forks_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/forks","keys_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/teams","hooks_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/hooks","issue_events_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/events","assignees_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/tags","blobs_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/languages","stargazers_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/stargazers","contributors_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/contributors","subscribers_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/subscribers","subscription_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/subscription","commits_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/merges","archive_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/downloads","issues_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/labels{/name}","releases_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/releases{/id}","deployments_url":"https://api.github.com/repos/guardian/kinesis-logback-appender/deployments","created_at":"2015-08-11T10:20:55Z","updated_at":"2018-05-11T09:53:07Z","pushed_at":"2018-05-15T11:15:45Z","git_url":"git://github.com/guardian/kinesis-logback-appender.git","ssh_url":"git@github.com:guardian/kinesis-logback-appender.git","clone_url":"https://github.com/guardian/kinesis-logback-appender.git","svn_url":"https://github.com/guardian/kinesis-logback-appender","homepage":null,"size":65,"stargazers_count":22,"watchers_count":22,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":17,"open_issues":12,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25"},"html":{"href":"https://github.com/guardian/kinesis-logback-appender/pull/25"},"issue":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/25"},"comments":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/kinesis-logback-appender/statuses/fea14cc5f17694f4bc8a65c30dbd1e39e682be5e"}},"author_association":"NONE"}}
{"actor":{"display_login":"sihil"}}