Skip to content

Instantly share code, notes, and snippets.

@dmannaarkin
Forked from Rudge/Reload logback in runtime
Created January 12, 2018 13:34
Show Gist options
  • Save dmannaarkin/e71c7a0f03a2dd738b942079189c8133 to your computer and use it in GitHub Desktop.
Save dmannaarkin/e71c7a0f03a2dd738b942079189c8133 to your computer and use it in GitHub Desktop.
Reload logback in runtime
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
configurator.doConfigure(new FileInputStream(new File(env.getProperty("logging.path"))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment