public void run() { if (mainConfigurationURL == null) { addInfo("Due to missing top level configuration file, skipping reconfiguration"); return; } LoggerContext lc = (LoggerContext) context; addInfo(CoreConstants.RESET_MSG_PREFIX + "named [" + context.getName() + "]"); if (mainConfigurationURL.toString().endsWith("xml")) { performXMLConfiguration(lc); } else if (mainConfigurationURL.toString().endsWith("groovy")) { if (EnvUtil.isGroovyAvailable()) { lc.reset(); // avoid directly referring to GafferConfigurator so as to avoid // loading groovy.lang.GroovyObject . See also http://jira.qos.ch/browse/LBCLASSIC-214 GafferUtil.runGafferConfiguratorOn(lc, this, mainConfigurationURL); } else { addError("Groovy classes are not available on the class path. ABORTING INITIALIZATION."); } } }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
@Override public void start() { configurationWatchList = ConfigurationWatchListUtil.getConfigurationWatchList(context); if (configurationWatchList != null) { mainConfigurationURL = configurationWatchList.getMainURL(); if (mainConfigurationURL == null) { addWarn("Due to missing top level configuration file, automatic reconfiguration is impossible."); return; } List<File> watchList = configurationWatchList.getCopyOfFileWatchList(); long inSeconds = refreshPeriod / 1000; addInfo("Will scan for changes in [" + watchList + "] every " + inSeconds + " seconds. "); synchronized (configurationWatchList) { updateNextCheck(System.currentTimeMillis()); } super.start(); } else { addWarn("Empty ConfigurationWatchList in context"); } }
private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList, URL mainURL) { JoranConfigurator joranConfigurator = new JoranConfigurator(); joranConfigurator.setContext(context); if (eventList != null) { addWarn("Falling back to previously registered safe configuration."); try { lc.reset(); JoranConfigurator.informContextOfURLUsedForConfiguration(context, mainURL); joranConfigurator.doConfigure(eventList); addInfo("Re-registering previous fallback configuration once more as a fallback configuration point"); joranConfigurator.registerSafeConfiguration(eventList); } catch (JoranException e) { addError("Unexpected exception thrown by a configuration considered safe.", e); } } else { addWarn("No previous configuration to fall back on."); } } }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
public void run() { if (mainConfigurationURL == null) { addInfo("Due to missing top level configuration file, skipping reconfiguration"); return; } LoggerContext lc = (LoggerContext) context; addInfo(CoreConstants.RESET_MSG_PREFIX + "named [" + context.getName() + "]"); if (mainConfigurationURL.toString().endsWith("xml")) { performXMLConfiguration(lc); } else if (mainConfigurationURL.toString().endsWith("groovy")) { if (EnvUtil.isGroovyAvailable()) { lc.reset(); // avoid directly referring to GafferConfigurator so as to avoid // loading groovy.lang.GroovyObject . See also http://jira.qos.ch/browse/LBCLASSIC-214 GafferUtil.runGafferConfiguratorOn(lc, this, mainConfigurationURL); } else { addError("Groovy classes are not available on the class path. ABORTING INITIALIZATION."); } } }
@Override public void start() { configurationWatchList = ConfigurationWatchListUtil.getConfigurationWatchList(context); if (configurationWatchList != null) { mainConfigurationURL = configurationWatchList.getMainURL(); if(mainConfigurationURL == null) { addWarn("Due to missing top level configuration file, automatic reconfiguration is impossible."); return; } List<File> watchList = configurationWatchList.getCopyOfFileWatchList(); long inSeconds = refreshPeriod / 1000; addInfo("Will scan for changes in [" + watchList + "] every " + inSeconds + " seconds. "); synchronized (configurationWatchList) { updateNextCheck(System.currentTimeMillis()); } super.start(); } else { addWarn("Empty ConfigurationWatchList in context"); } }
private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList, URL mainURL) { JoranConfigurator joranConfigurator = new JoranConfigurator(); joranConfigurator.setContext(context); if (eventList != null) { addWarn("Falling back to previously registered safe configuration."); try { lc.reset(); joranConfigurator.informContextOfURLUsedForConfiguration(context, mainURL); joranConfigurator.doConfigure(eventList); addInfo("Re-registering previous fallback configuration once more as a fallback configuration point"); joranConfigurator.registerSafeConfiguration(); } catch (JoranException e) { addError("Unexpected exception thrown by a configuration considered safe.", e); } } else { addWarn("No previous configuration to fall back on."); } } }
public void run() { if (mainConfigurationURL == null) { addInfo("Due to missing top level configuration file, skipping reconfiguration"); return; } LoggerContext lc = (LoggerContext) context; addInfo(CoreConstants.RESET_MSG_PREFIX + "named [" + context.getName() + "]"); if (mainConfigurationURL.toString().endsWith("xml")) { performXMLConfiguration(lc); } }
private void detachReconfigurationToNewThread() { // Even though this method resets the loggerContext, which clears the // list of turbo filters including this instance, it is still possible // for this instance to be subsequently invoked by another thread if it // was already executing when the context was reset. disableSubsequentRecofiguration(); addInfo("Detected change in [" + fileToScan + "]"); addInfo("Resetting and reconfiguring context [" + context.getName() + "]"); new ReconfiguringThread().start(); }
public void run() { if (mainConfigurationURL == null) { addInfo("Due to missing top level configuration file, skipping reconfiguration"); return; } LoggerContext lc = (LoggerContext) context; addInfo(CoreConstants.RESET_MSG_PREFIX + "named [" + context.getName() + "]"); if (mainConfigurationURL.toString().endsWith("xml")) { performXMLConfiguration(lc); } else if (mainConfigurationURL.toString().endsWith("groovy")) { if (EnvUtil.isGroovyAvailable()) { lc.reset(); // avoid directly referring to GafferConfigurator so as to avoid // loading groovy.lang.GroovyObject . See also http://jira.qos.ch/browse/LBCLASSIC-214 GafferUtil.runGafferConfiguratorOn(lc, this, mainConfigurationURL); } else { addError("Groovy classes are not available on the class path. ABORTING INITIALIZATION."); } } }
public void run() { if (mainConfigurationURL == null) { addInfo("Due to missing top level configuration file, skipping reconfiguration"); return; } LoggerContext lc = (LoggerContext) context; addInfo(CoreConstants.RESET_MSG_PREFIX + "named [" + context.getName() + "]"); if (mainConfigurationURL.toString().endsWith("xml")) { performXMLConfiguration(lc); } else if (mainConfigurationURL.toString().endsWith("groovy")) { if (EnvUtil.isGroovyAvailable()) { lc.reset(); // avoid directly referring to GafferConfigurator so as to avoid // loading groovy.lang.GroovyObject . See also http://jira.qos.ch/browse/LBCLASSIC-214 GafferUtil.runGafferConfiguratorOn(lc, this, mainConfigurationURL); } else { addError("Groovy classes are not available on the class path. ABORTING INITIALIZATION."); } } }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getScheduledExecutorService().submit(new ReconfiguringThread()); }
private void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
void detachReconfigurationToNewThread() { addInfo("Detected change in [" + configurationWatchList.getCopyOfFileWatchList() + "]"); context.getExecutorService().submit(new ReconfiguringThread()); }
@Override public void start() { configurationWatchList = ConfigurationWatchListUtil.getConfigurationWatchList(context); if (configurationWatchList != null) { mainConfigurationURL = configurationWatchList.getMainURL(); List<File> watchList = configurationWatchList.getCopyOfFileWatchList(); long inSeconds = refreshPeriod / 1000; addInfo("Will scan for changes in [" + watchList + "] every " + inSeconds + " seconds. "); synchronized (configurationWatchList) { updateNextCheck(System.currentTimeMillis()); } super.start(); } else { addWarn("Empty ConfigurationWatchList in context"); } }
private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList, URL mainURL) { JoranConfigurator joranConfigurator = new JoranConfigurator(); joranConfigurator.setContext(context); if (eventList != null) { addWarn("Falling back to previously registered safe configuration."); try { lc.reset(); joranConfigurator.informContextOfURLUsedForConfiguration(context, mainURL); joranConfigurator.doConfigure(eventList); addInfo("Re-registering previous fallback configuration once more as a fallback configuration point"); joranConfigurator.registerSafeConfiguration(); } catch (JoranException e) { addError("Unexpected exception thrown by a configuration considered safe.", e); } } else { addWarn("No previous configuration to fall back to."); } } }
private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList, URL mainURL) { JoranConfigurator joranConfigurator = new JoranConfigurator(); joranConfigurator.setContext(lc); if (eventList != null) { addWarn("Falling back to previously registered safe configuration."); try { lc.reset(); new AndroidContextUtil().setupProperties(lc); JoranConfigurator.informContextOfURLUsedForConfiguration(lc, mainURL); joranConfigurator.doConfigure(eventList); addInfo("Re-registering previous fallback configuration once more as a fallback configuration point"); joranConfigurator.registerSafeConfiguration(eventList); } catch (JoranException e) { addError("Unexpected exception thrown by a configuration considered safe.", e); } } else { addWarn("No previous configuration to fall back on."); } } }