@Test public void canConfigureLoggingFromURL() { initLogging(LOGBackConfigurerTest.class.getResource("/conf/logback.xml"), false); }
public static void initLogging(String logConfigLocation, boolean installJULBridge) { try { String location = resolvePlaceholders(logConfigLocation); if (location.indexOf("${") >= 0) { throw new IllegalStateException("unable to resolve certain placeholders: " + sanitise(location)); } location = location.replaceAll("\\\\", "/"); String notice = "If you are watching the console output, it may stop after this point, if configured to only write to file."; Logger.getLogger(LOGBackConfigurer.class.getName()).info("Initializing LOGBack from [" + sanitise(location) + "]. " + notice); initLogging(getURL(location), installJULBridge); } catch (FileNotFoundException ex) { throw new IllegalArgumentException("invalid '" + sanitise(logConfigLocation) + "' parameter: " + ex.getMessage()); } }
LOGBackConfigurer { public static void initLogging(String logConfigLocation, boolean installJULBridge) { try { String location = resolvePlaceholders(logConfigLocation); if (location.indexOf("${") >= 0) { throw new IllegalStateException("unable to resolve certain placeholders: " + sanitise(location)); } location = location.replaceAll("\\\\", "/"); String notice = "If you are watching the console output, it may stop after this point, if configured to only write to file."; Logger.getLogger(LOGBackConfigurer.class.getName()).info("Initializing LOGBack from [" + sanitise(location) + "]. " + notice); initLogging(getURL(location), installJULBridge); } catch (FileNotFoundException ex) { throw new IllegalArgumentException("invalid '" + sanitise(logConfigLocation) + "' parameter: " + ex.getMessage()); } } }
LOGBackConfigurer { public static void initLogging(String logConfigLocation, boolean installJULBridge) { try { String location = resolvePlaceholders(logConfigLocation); if (location.indexOf("${") >= 0) { throw new IllegalStateException("unable to resolve certain placeholders: " + sanitise(location)); } location = location.replaceAll("\\\\", "/"); String notice = "If you are watching the console output, it may stop after this point, if configured to only write to file."; Logger.getLogger(LOGBackConfigurer.class.getName()).info("Initializing LOGBack from [" + sanitise(location) + "]. " + notice); initLogging(getURL(location), installJULBridge); } catch (FileNotFoundException ex) { throw new IllegalArgumentException("invalid '" + sanitise(logConfigLocation) + "' parameter: " + ex.getMessage()); } } private  LOGBackConfigurer(); }
LOGBackConfigurer { public static void initLogging(String logConfigLocation, boolean installJULBridge) { try { String location = resolvePlaceholders(logConfigLocation); if (location.indexOf("${") >= 0) { throw new IllegalStateException("unable to resolve certain placeholders: " + sanitise(location)); } location = location.replaceAll("\\\\", "/"); String notice = "If you are watching the console output, it may stop after this point, if configured to only write to file."; Logger.getLogger(LOGBackConfigurer.class.getName()).info("Initializing LOGBack from [" + sanitise(location) + "]. " + notice); initLogging(getURL(location), installJULBridge); } catch (FileNotFoundException ex) { throw new IllegalArgumentException("invalid '" + sanitise(logConfigLocation) + "' parameter: " + ex.getMessage()); } } private  LOGBackConfigurer(); static void initLogging(String logConfigLocation, boolean installJULBridge); static void initLogging(URL url, boolean installJULBridge); static void shutdownLogging(boolean uninstallJULBridge); }
LOGBackConfigurer { public static void initLogging(String logConfigLocation, boolean installJULBridge) { try { String location = resolvePlaceholders(logConfigLocation); if (location.indexOf("${") >= 0) { throw new IllegalStateException("unable to resolve certain placeholders: " + sanitise(location)); } location = location.replaceAll("\\\\", "/"); String notice = "If you are watching the console output, it may stop after this point, if configured to only write to file."; Logger.getLogger(LOGBackConfigurer.class.getName()).info("Initializing LOGBack from [" + sanitise(location) + "]. " + notice); initLogging(getURL(location), installJULBridge); } catch (FileNotFoundException ex) { throw new IllegalArgumentException("invalid '" + sanitise(logConfigLocation) + "' parameter: " + ex.getMessage()); } } private  LOGBackConfigurer(); static void initLogging(String logConfigLocation, boolean installJULBridge); static void initLogging(URL url, boolean installJULBridge); static void shutdownLogging(boolean uninstallJULBridge);  }