{"action":"created","comment":{"url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments/40654679","id":40654679,"diff_hunk":"@@ -151,6 +146,43 @@ public void setSingleLoggerLevel(\n         logger.setLevel(newLevel);\n     }\n \n+    @GET\n+    @Timed\n+    @ApiOperation(value = \"Get recent log messages\")\n+    @ApiResponses(value = {\n+            @ApiResponse(code = 404, message = \"Memory appender not configured.\")\n+    })\n+    @Path(\"/messages/recent\")\n+    @Produces(MediaType.APPLICATION_JSON)\n+    public LogMessagesSummary messages(@ApiParam(name = \"max\", required = true) @QueryParam(\"max\") int max) {\n+        List<LogMessage> messages = new ArrayList<>();\n+\n+        Logger logger = Logger.getRootLogger();\n+        if (logger.getAppender(\"memory\") == null) {\n+            throw new WebApplicationException(404);\n+        }\n+\n+        MemoryAppender appender = (MemoryAppender) logger.getAppender(\"memory\");","path":"graylog2-server/src/main/java/org/graylog2/rest/resources/system/logs/LoggersResource.java","position":52,"original_position":52,"commit_id":"a237dd5c310398df233ba4b7d8ebea34f354b478","original_commit_id":"70b218b6c6d965a1b40c679325595fb4ef308953","user":{"login":"joschi","id":43951,"avatar_url":"https://avatars.githubusercontent.com/u/43951?v=3","gravatar_id":"","url":"https://api.github.com/users/joschi","html_url":"https://github.com/joschi","followers_url":"https://api.github.com/users/joschi/followers","following_url":"https://api.github.com/users/joschi/following{/other_user}","gists_url":"https://api.github.com/users/joschi/gists{/gist_id}","starred_url":"https://api.github.com/users/joschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joschi/subscriptions","organizations_url":"https://api.github.com/users/joschi/orgs","repos_url":"https://api.github.com/users/joschi/repos","events_url":"https://api.github.com/users/joschi/events{/privacy}","received_events_url":"https://api.github.com/users/joschi/received_events","type":"User","site_admin":false},"body":"This should check the actual type of the appender with `instanceof` first and throw an internal server error if it doesn't fit.","created_at":"2015-09-29T10:10:39Z","updated_at":"2015-09-29T10:10:39Z","html_url":"https://github.com/Graylog2/graylog2-server/pull/1452#discussion_r40654679","pull_request_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452","_links":{"self":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments/40654679"},"html":{"href":"https://github.com/Graylog2/graylog2-server/pull/1452#discussion_r40654679"},"pull_request":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452"}}},"pull_request":{"url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452","id":46209310,"html_url":"https://github.com/Graylog2/graylog2-server/pull/1452","diff_url":"https://github.com/Graylog2/graylog2-server/pull/1452.diff","patch_url":"https://github.com/Graylog2/graylog2-server/pull/1452.patch","issue_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/1452","number":1452,"state":"open","locked":false,"title":"Make internal logs accessible via REST API call","user":{"login":"lennartkoopmann","id":35022,"avatar_url":"https://avatars.githubusercontent.com/u/35022?v=3","gravatar_id":"","url":"https://api.github.com/users/lennartkoopmann","html_url":"https://github.com/lennartkoopmann","followers_url":"https://api.github.com/users/lennartkoopmann/followers","following_url":"https://api.github.com/users/lennartkoopmann/following{/other_user}","gists_url":"https://api.github.com/users/lennartkoopmann/gists{/gist_id}","starred_url":"https://api.github.com/users/lennartkoopmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lennartkoopmann/subscriptions","organizations_url":"https://api.github.com/users/lennartkoopmann/orgs","repos_url":"https://api.github.com/users/lennartkoopmann/repos","events_url":"https://api.github.com/users/lennartkoopmann/events{/privacy}","received_events_url":"https://api.github.com/users/lennartkoopmann/received_events","type":"User","site_admin":false},"body":"* Log4J appender writing logs to a fixed size in memory destination\r\n* REST API call to access the logs\r\n\r\nThis allows Apollo to collect the most recent logs and also the graylog-web-interface to display server logs. This will make maintenance easier and our support faster.","created_at":"2015-09-28T21:16:48Z","updated_at":"2015-09-29T10:10:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96517362870ab35c5daea753f071e9dace9ece65","assignee":{"login":"dennisoelkers","id":41929,"avatar_url":"https://avatars.githubusercontent.com/u/41929?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisoelkers","html_url":"https://github.com/dennisoelkers","followers_url":"https://api.github.com/users/dennisoelkers/followers","following_url":"https://api.github.com/users/dennisoelkers/following{/other_user}","gists_url":"https://api.github.com/users/dennisoelkers/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisoelkers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisoelkers/subscriptions","organizations_url":"https://api.github.com/users/dennisoelkers/orgs","repos_url":"https://api.github.com/users/dennisoelkers/repos","events_url":"https://api.github.com/users/dennisoelkers/events{/privacy}","received_events_url":"https://api.github.com/users/dennisoelkers/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones/39","html_url":"https://github.com/Graylog2/graylog2-server/milestones/1.x","labels_url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones/39/labels","id":1170286,"number":39,"title":"1.x","description":"Future release in the 1.x scope.","creator":{"login":"zexxon","id":1154318,"avatar_url":"https://avatars.githubusercontent.com/u/1154318?v=3","gravatar_id":"","url":"https://api.github.com/users/zexxon","html_url":"https://github.com/zexxon","followers_url":"https://api.github.com/users/zexxon/followers","following_url":"https://api.github.com/users/zexxon/following{/other_user}","gists_url":"https://api.github.com/users/zexxon/gists{/gist_id}","starred_url":"https://api.github.com/users/zexxon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zexxon/subscriptions","organizations_url":"https://api.github.com/users/zexxon/orgs","repos_url":"https://api.github.com/users/zexxon/repos","events_url":"https://api.github.com/users/zexxon/events{/privacy}","received_events_url":"https://api.github.com/users/zexxon/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":0,"state":"open","created_at":"2015-06-18T09:17:02Z","updated_at":"2015-09-28T21:17:23Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452/commits","review_comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452/comments","review_comment_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/1452/comments","statuses_url":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/a237dd5c310398df233ba4b7d8ebea34f354b478","head":{"label":"Graylog2:logs-rest","ref":"logs-rest","sha":"a237dd5c310398df233ba4b7d8ebea34f354b478","user":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"repo":{"id":671825,"name":"graylog2-server","full_name":"Graylog2/graylog2-server","owner":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Graylog2/graylog2-server","description":"Free and open source log management","fork":false,"url":"https://api.github.com/repos/Graylog2/graylog2-server","forks_url":"https://api.github.com/repos/Graylog2/graylog2-server/forks","keys_url":"https://api.github.com/repos/Graylog2/graylog2-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Graylog2/graylog2-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Graylog2/graylog2-server/teams","hooks_url":"https://api.github.com/repos/Graylog2/graylog2-server/hooks","issue_events_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/events{/number}","events_url":"https://api.github.com/repos/Graylog2/graylog2-server/events","assignees_url":"https://api.github.com/repos/Graylog2/graylog2-server/assignees{/user}","branches_url":"https://api.github.com/repos/Graylog2/graylog2-server/branches{/branch}","tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/tags","blobs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Graylog2/graylog2-server/languages","stargazers_url":"https://api.github.com/repos/Graylog2/graylog2-server/stargazers","contributors_url":"https://api.github.com/repos/Graylog2/graylog2-server/contributors","subscribers_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscribers","subscription_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscription","commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Graylog2/graylog2-server/contents/{+path}","compare_url":"https://api.github.com/repos/Graylog2/graylog2-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Graylog2/graylog2-server/merges","archive_url":"https://api.github.com/repos/Graylog2/graylog2-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Graylog2/graylog2-server/downloads","issues_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues{/number}","pulls_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Graylog2/graylog2-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Graylog2/graylog2-server/labels{/name}","releases_url":"https://api.github.com/repos/Graylog2/graylog2-server/releases{/id}","created_at":"2010-05-17T21:27:02Z","updated_at":"2015-09-27T11:07:54Z","pushed_at":"2015-09-29T10:07:32Z","git_url":"git://github.com/Graylog2/graylog2-server.git","ssh_url":"git@github.com:Graylog2/graylog2-server.git","clone_url":"https://github.com/Graylog2/graylog2-server.git","svn_url":"https://github.com/Graylog2/graylog2-server","homepage":"https://www.graylog.org/","size":56371,"stargazers_count":1374,"watchers_count":1374,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":229,"mirror_url":null,"open_issues_count":167,"forks":229,"open_issues":167,"watchers":1374,"default_branch":"master"}},"base":{"label":"Graylog2:1.2","ref":"1.2","sha":"336a1abd884587f2d82a07b5b19a81ef8b68e517","user":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"repo":{"id":671825,"name":"graylog2-server","full_name":"Graylog2/graylog2-server","owner":{"login":"Graylog2","id":474892,"avatar_url":"https://avatars.githubusercontent.com/u/474892?v=3","gravatar_id":"","url":"https://api.github.com/users/Graylog2","html_url":"https://github.com/Graylog2","followers_url":"https://api.github.com/users/Graylog2/followers","following_url":"https://api.github.com/users/Graylog2/following{/other_user}","gists_url":"https://api.github.com/users/Graylog2/gists{/gist_id}","starred_url":"https://api.github.com/users/Graylog2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Graylog2/subscriptions","organizations_url":"https://api.github.com/users/Graylog2/orgs","repos_url":"https://api.github.com/users/Graylog2/repos","events_url":"https://api.github.com/users/Graylog2/events{/privacy}","received_events_url":"https://api.github.com/users/Graylog2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Graylog2/graylog2-server","description":"Free and open source log management","fork":false,"url":"https://api.github.com/repos/Graylog2/graylog2-server","forks_url":"https://api.github.com/repos/Graylog2/graylog2-server/forks","keys_url":"https://api.github.com/repos/Graylog2/graylog2-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Graylog2/graylog2-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Graylog2/graylog2-server/teams","hooks_url":"https://api.github.com/repos/Graylog2/graylog2-server/hooks","issue_events_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/events{/number}","events_url":"https://api.github.com/repos/Graylog2/graylog2-server/events","assignees_url":"https://api.github.com/repos/Graylog2/graylog2-server/assignees{/user}","branches_url":"https://api.github.com/repos/Graylog2/graylog2-server/branches{/branch}","tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/tags","blobs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Graylog2/graylog2-server/languages","stargazers_url":"https://api.github.com/repos/Graylog2/graylog2-server/stargazers","contributors_url":"https://api.github.com/repos/Graylog2/graylog2-server/contributors","subscribers_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscribers","subscription_url":"https://api.github.com/repos/Graylog2/graylog2-server/subscription","commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Graylog2/graylog2-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Graylog2/graylog2-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Graylog2/graylog2-server/contents/{+path}","compare_url":"https://api.github.com/repos/Graylog2/graylog2-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Graylog2/graylog2-server/merges","archive_url":"https://api.github.com/repos/Graylog2/graylog2-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Graylog2/graylog2-server/downloads","issues_url":"https://api.github.com/repos/Graylog2/graylog2-server/issues{/number}","pulls_url":"https://api.github.com/repos/Graylog2/graylog2-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Graylog2/graylog2-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Graylog2/graylog2-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Graylog2/graylog2-server/labels{/name}","releases_url":"https://api.github.com/repos/Graylog2/graylog2-server/releases{/id}","created_at":"2010-05-17T21:27:02Z","updated_at":"2015-09-27T11:07:54Z","pushed_at":"2015-09-29T10:07:32Z","git_url":"git://github.com/Graylog2/graylog2-server.git","ssh_url":"git@github.com:Graylog2/graylog2-server.git","clone_url":"https://github.com/Graylog2/graylog2-server.git","svn_url":"https://github.com/Graylog2/graylog2-server","homepage":"https://www.graylog.org/","size":56371,"stargazers_count":1374,"watchers_count":1374,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":229,"mirror_url":null,"open_issues_count":167,"forks":229,"open_issues":167,"watchers":1374,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452"},"html":{"href":"https://github.com/Graylog2/graylog2-server/pull/1452"},"issue":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/issues/1452"},"comments":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/issues/1452/comments"},"review_comments":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452/comments"},"review_comment":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/pulls/1452/commits"},"statuses":{"href":"https://api.github.com/repos/Graylog2/graylog2-server/statuses/a237dd5c310398df233ba4b7d8ebea34f354b478"}}}}