{"action":"created","comment":{"url":"https://api.github.com/repos/dropwizard/dropwizard/pulls/comments/64748421","id":64748421,"diff_hunk":"@@ -125,7 +132,45 @@ public void hasMaxFileSizeValidation() throws Exception{\n         errors = ConstraintViolations.format(validator.validate(fileAppenderFactory));\n         assertThat(errors).isEmpty();\n     }\n+    \n+    @Test\n+    public void testCurrentFileNameErrorWhenArchiveIsNotEnabled() throws Exception {\n+        FileAppenderFactory fileAppenderFactory = new FileAppenderFactory();\n+        fileAppenderFactory.setArchive(false);\n+        ImmutableList<String> errors =\n+                ConstraintViolations.format(validator.validate(fileAppenderFactory));\n+        assertThat(errors)\n+                .containsOnly(\"currentLogFilename can only be null when archiving is enabled\");\n+        fileAppenderFactory.setCurrentLogFilename(\"test\");\n+        errors = ConstraintViolations.format(validator.validate(fileAppenderFactory));\n+        assertThat(errors).isEmpty();\n+    }\n+    \n+    @Test\n+    public void testCurrentFileNameCanBeNullWhenArchiveIsEnabled() throws Exception {\n+        FileAppenderFactory fileAppenderFactory = new FileAppenderFactory();\n+        fileAppenderFactory.setArchive(true);\n+        fileAppenderFactory.setArchivedLogFilenamePattern(\"name-to-be-used\");\n+        fileAppenderFactory.setCurrentLogFilename(null);\n+        ImmutableList<String> errors =\n+                ConstraintViolations.format(validator.validate(fileAppenderFactory));\n+        assertThat(errors).isEmpty();\n+    }\n+\n+    @Test\n+    public void testCurrentLogFileNameIsEmptyAndAppenderUsesArchivedNameInstead() throws Exception {","path":"dropwizard-logging/src/test/java/io/dropwizard/logging/FileAppenderFactoryTest.java","position":67,"original_position":67,"commit_id":"274f13dd58224d548cb16d422dad69b18d549242","original_commit_id":"274f13dd58224d548cb16d422dad69b18d549242","user":{"login":"nickbabcock","id":2106129,"avatar_url":"https://avatars.githubusercontent.com/u/2106129?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbabcock","html_url":"https://github.com/nickbabcock","followers_url":"https://api.github.com/users/nickbabcock/followers","following_url":"https://api.github.com/users/nickbabcock/following{/other_user}","gists_url":"https://api.github.com/users/nickbabcock/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbabcock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbabcock/subscriptions","organizations_url":"https://api.github.com/users/nickbabcock/orgs","repos_url":"https://api.github.com/users/nickbabcock/repos","events_url":"https://api.github.com/users/nickbabcock/events{/privacy}","received_events_url":"https://api.github.com/users/nickbabcock/received_events","type":"User","site_admin":false},"body":"How do you feel about the following implementation instead (it's a bit shorter):\r\n\r\n```java\r\n@Test\r\npublic void testCurrentLogFileNameIsEmptyAndAppenderUsesArchivedNameInstead() throws Exception {\r\n    final FileAppenderFactory<ILoggingEvent> appenderFactory = new FileAppenderFactory<>();\r\n    appenderFactory.setArchivedLogFilenamePattern(folder.newFile(\"test-archived-name-%d.log\").toString());\r\n    final FileAppender<ILoggingEvent> rollingAppender = appenderFactory.buildAppender(new LoggerContext());\r\n\r\n    final String file = rollingAppender.getFile();\r\n    final String dateSuffix = LocalDateTime.now().format(DateTimeFormatter.ofPattern(\"YYYY-MM-dd\"));\r\n    final String name = Files.getNameWithoutExtension(file);\r\n    Assert.assertEquals(\"test-archived-name-\" + dateSuffix, name);\r\n}\r\n```","created_at":"2016-05-26T13:51:58Z","updated_at":"2016-05-26T13:51:58Z","html_url":"https://github.com/dropwizard/dropwizard/pull/1561#discussion_r64748421","pull_request_url":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561","_links":{"self":{"href":"https://api.github.com/repos/dropwizard/dropwizard/pulls/comments/64748421"},"html":{"href":"https://github.com/dropwizard/dropwizard/pull/1561#discussion_r64748421"},"pull_request":{"href":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561"}}},"pull_request":{"url":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561","id":71548545,"html_url":"https://github.com/dropwizard/dropwizard/pull/1561","diff_url":"https://github.com/dropwizard/dropwizard/pull/1561.diff","patch_url":"https://github.com/dropwizard/dropwizard/pull/1561.patch","issue_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1561","number":1561,"state":"open","locked":false,"title":"#1278 pull request for FileAppenderFactory","user":{"login":"pandaadb","id":15109364,"avatar_url":"https://avatars.githubusercontent.com/u/15109364?v=3","gravatar_id":"","url":"https://api.github.com/users/pandaadb","html_url":"https://github.com/pandaadb","followers_url":"https://api.github.com/users/pandaadb/followers","following_url":"https://api.github.com/users/pandaadb/following{/other_user}","gists_url":"https://api.github.com/users/pandaadb/gists{/gist_id}","starred_url":"https://api.github.com/users/pandaadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandaadb/subscriptions","organizations_url":"https://api.github.com/users/pandaadb/orgs","repos_url":"https://api.github.com/users/pandaadb/repos","events_url":"https://api.github.com/users/pandaadb/events{/privacy}","received_events_url":"https://api.github.com/users/pandaadb/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nthis pull request is with regards to: \r\n\r\nFileAppenderFactory not valid for null currentLogFilename #1278\r\n\r\nFirst time pull request, let me know if there is something I forgot. \r\n\r\nThis fix adds: \r\n* New validation based on the archived configuration to allow for null currentFileNames in case one wants to use the rolling policies file policy instead \r\n* Tests to assure that validation works and the rolling policy's filename is used instead. ","created_at":"2016-05-26T12:39:25Z","updated_at":"2016-05-26T13:51:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56839be25180ec000be11b619bdd4124db1de377","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561/commits","review_comments_url":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561/comments","review_comment_url":"https://api.github.com/repos/dropwizard/dropwizard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1561/comments","statuses_url":"https://api.github.com/repos/dropwizard/dropwizard/statuses/274f13dd58224d548cb16d422dad69b18d549242","head":{"label":"pandaadb:1278-pull-request","ref":"1278-pull-request","sha":"274f13dd58224d548cb16d422dad69b18d549242","user":{"login":"pandaadb","id":15109364,"avatar_url":"https://avatars.githubusercontent.com/u/15109364?v=3","gravatar_id":"","url":"https://api.github.com/users/pandaadb","html_url":"https://github.com/pandaadb","followers_url":"https://api.github.com/users/pandaadb/followers","following_url":"https://api.github.com/users/pandaadb/following{/other_user}","gists_url":"https://api.github.com/users/pandaadb/gists{/gist_id}","starred_url":"https://api.github.com/users/pandaadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandaadb/subscriptions","organizations_url":"https://api.github.com/users/pandaadb/orgs","repos_url":"https://api.github.com/users/pandaadb/repos","events_url":"https://api.github.com/users/pandaadb/events{/privacy}","received_events_url":"https://api.github.com/users/pandaadb/received_events","type":"User","site_admin":false},"repo":{"id":59747316,"name":"dropwizard","full_name":"pandaadb/dropwizard","owner":{"login":"pandaadb","id":15109364,"avatar_url":"https://avatars.githubusercontent.com/u/15109364?v=3","gravatar_id":"","url":"https://api.github.com/users/pandaadb","html_url":"https://github.com/pandaadb","followers_url":"https://api.github.com/users/pandaadb/followers","following_url":"https://api.github.com/users/pandaadb/following{/other_user}","gists_url":"https://api.github.com/users/pandaadb/gists{/gist_id}","starred_url":"https://api.github.com/users/pandaadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pandaadb/subscriptions","organizations_url":"https://api.github.com/users/pandaadb/orgs","repos_url":"https://api.github.com/users/pandaadb/repos","events_url":"https://api.github.com/users/pandaadb/events{/privacy}","received_events_url":"https://api.github.com/users/pandaadb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pandaadb/dropwizard","description":"A damn simple library for building production-ready RESTful web services.","fork":true,"url":"https://api.github.com/repos/pandaadb/dropwizard","forks_url":"https://api.github.com/repos/pandaadb/dropwizard/forks","keys_url":"https://api.github.com/repos/pandaadb/dropwizard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pandaadb/dropwizard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pandaadb/dropwizard/teams","hooks_url":"https://api.github.com/repos/pandaadb/dropwizard/hooks","issue_events_url":"https://api.github.com/repos/pandaadb/dropwizard/issues/events{/number}","events_url":"https://api.github.com/repos/pandaadb/dropwizard/events","assignees_url":"https://api.github.com/repos/pandaadb/dropwizard/assignees{/user}","branches_url":"https://api.github.com/repos/pandaadb/dropwizard/branches{/branch}","tags_url":"https://api.github.com/repos/pandaadb/dropwizard/tags","blobs_url":"https://api.github.com/repos/pandaadb/dropwizard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pandaadb/dropwizard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pandaadb/dropwizard/git/refs{/sha}","trees_url":"https://api.github.com/repos/pandaadb/dropwizard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pandaadb/dropwizard/statuses/{sha}","languages_url":"https://api.github.com/repos/pandaadb/dropwizard/languages","stargazers_url":"https://api.github.com/repos/pandaadb/dropwizard/stargazers","contributors_url":"https://api.github.com/repos/pandaadb/dropwizard/contributors","subscribers_url":"https://api.github.com/repos/pandaadb/dropwizard/subscribers","subscription_url":"https://api.github.com/repos/pandaadb/dropwizard/subscription","commits_url":"https://api.github.com/repos/pandaadb/dropwizard/commits{/sha}","git_commits_url":"https://api.github.com/repos/pandaadb/dropwizard/git/commits{/sha}","comments_url":"https://api.github.com/repos/pandaadb/dropwizard/comments{/number}","issue_comment_url":"https://api.github.com/repos/pandaadb/dropwizard/issues/comments{/number}","contents_url":"https://api.github.com/repos/pandaadb/dropwizard/contents/{+path}","compare_url":"https://api.github.com/repos/pandaadb/dropwizard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pandaadb/dropwizard/merges","archive_url":"https://api.github.com/repos/pandaadb/dropwizard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pandaadb/dropwizard/downloads","issues_url":"https://api.github.com/repos/pandaadb/dropwizard/issues{/number}","pulls_url":"https://api.github.com/repos/pandaadb/dropwizard/pulls{/number}","milestones_url":"https://api.github.com/repos/pandaadb/dropwizard/milestones{/number}","notifications_url":"https://api.github.com/repos/pandaadb/dropwizard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pandaadb/dropwizard/labels{/name}","releases_url":"https://api.github.com/repos/pandaadb/dropwizard/releases{/id}","deployments_url":"https://api.github.com/repos/pandaadb/dropwizard/deployments","created_at":"2016-05-26T12:10:02Z","updated_at":"2016-05-26T12:10:06Z","pushed_at":"2016-05-26T13:40:54Z","git_url":"git://github.com/pandaadb/dropwizard.git","ssh_url":"git@github.com:pandaadb/dropwizard.git","clone_url":"https://github.com/pandaadb/dropwizard.git","svn_url":"https://github.com/pandaadb/dropwizard","homepage":"http://www.dropwizard.io","size":31450,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"dropwizard:master","ref":"master","sha":"b5fbc072da363211327d4e69b2348f8a24ce6b47","user":{"login":"dropwizard","id":5478557,"avatar_url":"https://avatars.githubusercontent.com/u/5478557?v=3","gravatar_id":"","url":"https://api.github.com/users/dropwizard","html_url":"https://github.com/dropwizard","followers_url":"https://api.github.com/users/dropwizard/followers","following_url":"https://api.github.com/users/dropwizard/following{/other_user}","gists_url":"https://api.github.com/users/dropwizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dropwizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropwizard/subscriptions","organizations_url":"https://api.github.com/users/dropwizard/orgs","repos_url":"https://api.github.com/users/dropwizard/repos","events_url":"https://api.github.com/users/dropwizard/events{/privacy}","received_events_url":"https://api.github.com/users/dropwizard/received_events","type":"Organization","site_admin":false},"repo":{"id":1272129,"name":"dropwizard","full_name":"dropwizard/dropwizard","owner":{"login":"dropwizard","id":5478557,"avatar_url":"https://avatars.githubusercontent.com/u/5478557?v=3","gravatar_id":"","url":"https://api.github.com/users/dropwizard","html_url":"https://github.com/dropwizard","followers_url":"https://api.github.com/users/dropwizard/followers","following_url":"https://api.github.com/users/dropwizard/following{/other_user}","gists_url":"https://api.github.com/users/dropwizard/gists{/gist_id}","starred_url":"https://api.github.com/users/dropwizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dropwizard/subscriptions","organizations_url":"https://api.github.com/users/dropwizard/orgs","repos_url":"https://api.github.com/users/dropwizard/repos","events_url":"https://api.github.com/users/dropwizard/events{/privacy}","received_events_url":"https://api.github.com/users/dropwizard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dropwizard/dropwizard","description":"A damn simple library for building production-ready RESTful web services.","fork":false,"url":"https://api.github.com/repos/dropwizard/dropwizard","forks_url":"https://api.github.com/repos/dropwizard/dropwizard/forks","keys_url":"https://api.github.com/repos/dropwizard/dropwizard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dropwizard/dropwizard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dropwizard/dropwizard/teams","hooks_url":"https://api.github.com/repos/dropwizard/dropwizard/hooks","issue_events_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/events{/number}","events_url":"https://api.github.com/repos/dropwizard/dropwizard/events","assignees_url":"https://api.github.com/repos/dropwizard/dropwizard/assignees{/user}","branches_url":"https://api.github.com/repos/dropwizard/dropwizard/branches{/branch}","tags_url":"https://api.github.com/repos/dropwizard/dropwizard/tags","blobs_url":"https://api.github.com/repos/dropwizard/dropwizard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dropwizard/dropwizard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dropwizard/dropwizard/git/refs{/sha}","trees_url":"https://api.github.com/repos/dropwizard/dropwizard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dropwizard/dropwizard/statuses/{sha}","languages_url":"https://api.github.com/repos/dropwizard/dropwizard/languages","stargazers_url":"https://api.github.com/repos/dropwizard/dropwizard/stargazers","contributors_url":"https://api.github.com/repos/dropwizard/dropwizard/contributors","subscribers_url":"https://api.github.com/repos/dropwizard/dropwizard/subscribers","subscription_url":"https://api.github.com/repos/dropwizard/dropwizard/subscription","commits_url":"https://api.github.com/repos/dropwizard/dropwizard/commits{/sha}","git_commits_url":"https://api.github.com/repos/dropwizard/dropwizard/git/commits{/sha}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/comments{/number}","issue_comment_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/comments{/number}","contents_url":"https://api.github.com/repos/dropwizard/dropwizard/contents/{+path}","compare_url":"https://api.github.com/repos/dropwizard/dropwizard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dropwizard/dropwizard/merges","archive_url":"https://api.github.com/repos/dropwizard/dropwizard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dropwizard/dropwizard/downloads","issues_url":"https://api.github.com/repos/dropwizard/dropwizard/issues{/number}","pulls_url":"https://api.github.com/repos/dropwizard/dropwizard/pulls{/number}","milestones_url":"https://api.github.com/repos/dropwizard/dropwizard/milestones{/number}","notifications_url":"https://api.github.com/repos/dropwizard/dropwizard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dropwizard/dropwizard/labels{/name}","releases_url":"https://api.github.com/repos/dropwizard/dropwizard/releases{/id}","deployments_url":"https://api.github.com/repos/dropwizard/dropwizard/deployments","created_at":"2011-01-19T19:52:29Z","updated_at":"2016-05-26T10:45:35Z","pushed_at":"2016-05-26T13:40:55Z","git_url":"git://github.com/dropwizard/dropwizard.git","ssh_url":"git@github.com:dropwizard/dropwizard.git","clone_url":"https://github.com/dropwizard/dropwizard.git","svn_url":"https://github.com/dropwizard/dropwizard","homepage":"http://www.dropwizard.io","size":34789,"stargazers_count":4427,"watchers_count":4427,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1959,"mirror_url":null,"open_issues_count":54,"forks":1959,"open_issues":54,"watchers":4427,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561"},"html":{"href":"https://github.com/dropwizard/dropwizard/pull/1561"},"issue":{"href":"https://api.github.com/repos/dropwizard/dropwizard/issues/1561"},"comments":{"href":"https://api.github.com/repos/dropwizard/dropwizard/issues/1561/comments"},"review_comments":{"href":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561/comments"},"review_comment":{"href":"https://api.github.com/repos/dropwizard/dropwizard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dropwizard/dropwizard/pulls/1561/commits"},"statuses":{"href":"https://api.github.com/repos/dropwizard/dropwizard/statuses/274f13dd58224d548cb16d422dad69b18d549242"}}}}
{"actor":{"display_login":"nickbabcock"}}