Skip to content

Commit

Permalink
remove unused private method joranConfigureByResource, deprecate publ…
Browse files Browse the repository at this point in the history
…ic method configureByResource

Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Nov 29, 2022
1 parent 577e20d commit 86f3889
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public ContextInitializer(LoggerContext loggerContext) {
this.loggerContext = loggerContext;
}

/**
* This method is deprecated with no replacement
* @param url
* @throws JoranException
*/
@Deprecated
public void configureByResource(URL url) throws JoranException {
if (url == null) {
throw new IllegalArgumentException("URL argument cannot be null");
Expand All @@ -67,12 +73,6 @@ public void configureByResource(URL url) throws JoranException {
}
}

void joranConfigureByResource(URL url) throws JoranException {
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(loggerContext);
configurator.doConfigure(url);
}

public void autoConfig() throws JoranException {
autoConfig(Configurator.class.getClassLoader());
}
Expand Down

3 comments on commit 86f3889

@eitch
Copy link

@eitch eitch commented on 86f3889 Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this deprecated? I was using it, and it was removed in an update version, not even a major, rather sad. I've been using this to reload the configuration. Is there an alternative?

@bostond
Copy link

@bostond bostond commented on 86f3889 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@ceki
Copy link
Member Author

@ceki ceki commented on 86f3889 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to issue 704

The deprecated method in question was removed because it was preventing the decoupling of logback initialization from JoranConfigurator.

Please note the DefaultJoranConfigurator.configureByResource method is identical to ContextInitializer.configureByResource and can be used instead.

Please sign in to comment.