/** * Callback method from ch.qos.logback.core.joran.GenericConfigurator. * * @param configurator the configurator object * @param url configuration file url */ public void initLogback(final Object configurator, final URL url) { try { final URI uri = url.toURI(); // skip double registration on reload if (registeredURIs.contains(uri)) return; LOGGER.debug("Watching '{}' URL for Logback configuration changes.", url); registeredURIs.add(uri); watcher.addEventListener(appClassLoader, uri, new WatchEventListener() { @Override public void onEvent(WatchFileEvent event) { if (event.getEventType() != FileEvent.DELETE) reload(configurator, url); } }); } catch (Exception e) { LOGGER.error("Exception initializing logback configurator {} on url {}.", e, configurator, url); } }
LOGGER.debug("Watching '{}' URI for Log4j2 configuration changes.", configURI); registeredURIs.add(configURI); watcher.addEventListener(appClassLoader, parentUri, new WatchEventListener() {
watcher.addEventListener(appClassLoader, uri, new WatchEventListener() { @Override public void onEvent(WatchFileEvent event) {
LOGGER.info("Initialize hotswap on URL {}.", uri); listener = new AutoHotswapPathEventListener(this); watcher.addEventListener(null, uri, listener); } catch (URISyntaxException e) { LOGGER.error("Unable to watch path '{}' for changes.", e, resource);
continue; } else { watcher.addEventListener(appClassLoader, basePackageURL, new WatchEventListener() { @Override public void onEvent(WatchFileEvent event) {
LOGGER.info("Registering archive path '{}'", archivePath); watcher.addEventListener(appClassLoader, uri, new WatchEventListener() { @Override public void onEvent(WatchFileEvent event) {