{"action":"created","issue":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1658","repository_url":"https://api.github.com/repos/dropwizard/dropwizard","labels_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1658/labels{/name}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1658/comments","events_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1658/events","html_url":"https://github.com/dropwizard/dropwizard/issues/1658","id":168507430,"number":1658,"title":"Dropwizard could not log INFO log to console and log file at very early stage of application initialization","user":{"login":"dknc","id":4233129,"avatar_url":"https://avatars.githubusercontent.com/u/4233129?v=3","gravatar_id":"","url":"https://api.github.com/users/dknc","html_url":"https://github.com/dknc","followers_url":"https://api.github.com/users/dknc/followers","following_url":"https://api.github.com/users/dknc/following{/other_user}","gists_url":"https://api.github.com/users/dknc/gists{/gist_id}","starred_url":"https://api.github.com/users/dknc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dknc/subscriptions","organizations_url":"https://api.github.com/users/dknc/orgs","repos_url":"https://api.github.com/users/dknc/repos","events_url":"https://api.github.com/users/dknc/events{/privacy}","received_events_url":"https://api.github.com/users/dknc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-31T08:10:44Z","updated_at":"2016-08-02T17:39:02Z","closed_at":null,"body":"Dropwizard could not log INFO log to console and log file at very early stage of application initialization. \r\n\r\nMy dropwizard application implemented a StrSubstitutor and configured it in the initialize method\r\n\r\n```@Override\r\n  public void initialize(Bootstrap<ChatServiceAppConfiguration> bootstrap)\r\n  {\r\n    // Enable variable substitution with environment variables\r\n    bootstrap.setConfigurationSourceProvider(\r\n        new SubstitutingSourceProvider(\r\n            bootstrap.getConfigurationSourceProvider(),\r\n            new AppPropertySubstitutor(false)\r\n        )\r\n    );\r\n  }\r\n```\r\nThe AppPropertySubstitutor depends on a component which uses apache common logging.\r\nAll INFO level log is not written to the console and the log file in the depended component.\r\n\r\nHave checked that jcl-over-slf4j.jar is successfully packaged into the application jar.\r\n\r\nThe cause is that the default constructor of the dropwizard Application calls  \r\n```\r\nBootstrapLogging.bootstrap()\r\n```\r\nThe default logger initialized a ThresholdFilter with log level Level.WARN, thus INFO log is denied.\r\n\r\nAs the BootstrapLogging.bootstrap() can only be called once. Super constructor is always executed when creating sub class instance. thus it is not able to bootstrap logging with different log level other than Level.WARN.\r\n\r\nDropwizard should bootstrap logging with the logging configuration defined in yaml at very first stage.\r\n\r\nDropwizard version:  1.0.0-rc4\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/comments/236981869","html_url":"https://github.com/dropwizard/dropwizard/issues/1658#issuecomment-236981869","issue_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1658","id":236981869,"user":{"login":"evnm","id":110020,"avatar_url":"https://avatars.githubusercontent.com/u/110020?v=3","gravatar_id":"","url":"https://api.github.com/users/evnm","html_url":"https://github.com/evnm","followers_url":"https://api.github.com/users/evnm/followers","following_url":"https://api.github.com/users/evnm/following{/other_user}","gists_url":"https://api.github.com/users/evnm/gists{/gist_id}","starred_url":"https://api.github.com/users/evnm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evnm/subscriptions","organizations_url":"https://api.github.com/users/evnm/orgs","repos_url":"https://api.github.com/users/evnm/repos","events_url":"https://api.github.com/users/evnm/events{/privacy}","received_events_url":"https://api.github.com/users/evnm/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T17:39:02Z","updated_at":"2016-08-02T17:39:02Z","body":"You're right, my mistake. Had to look this one up: https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.5\r\n\r\n[The Javadoc comment on `Application`](https://github.com/dropwizard/dropwizard/blob/master/dropwizard-core/src/main/java/io/dropwizard/Application.java#L15-L17) is misleading, as it insinuates that subclasses _can_ control the level of bootstrapped logging. This should be fixed.\r\n\r\nI think it'd be a good idea to provide a means of configuring the log level passed to `BootstrapLogging.bootstrap(Level)`: #1662"}}
{"actor":{"display_login":"evnm"}}