@Override public String toString() { return this.getClass().getName() + "(" + context.getName() + ")"; } }
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 body(InterpretationContext ec, String body) { String finalBody = ec.subst(body); addInfo("Setting logger context name as [" + finalBody + "]"); try { context.setName(finalBody); } catch (IllegalStateException e) { addError("Failed to rename context [" + context.getName() + "] as [" + finalBody + "]", e); } }
addInfo("begin"); String contextName = context.getName(); String contextNameAttributeVal = attributes.getValue(CONTEXT_NAME_ATTRIBUTE_NAME); if (!OptionHelper.isEmpty(contextNameAttributeVal)) {
addInfo(CoreConstants.RESET_MSG_PREFIX + "named [" + context.getName() + "]");
@Override public String toString() { return this.getClass().getName() + "(" + context.getName() + ")"; } }
/** * Print context's status data with a timestamp higher than the threshold. * @param context */ public static void print(Context context, long threshold) { if (context == null) { throw new IllegalArgumentException("Context argument cannot be null"); } StatusManager sm = context.getStatusManager(); if (sm == null) { ps.println("WARN: Context named \"" + context.getName() + "\" has no status manager"); } else { print(sm, threshold); } }
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."); } } }
/** * Print the contents of the context status, but only if they contain * warnings or errors occurring later then the threshold. * * @param context */ public static void printInCaseOfErrorsOrWarnings(Context context, long threshold) { if (context == null) { throw new IllegalArgumentException("Context argument cannot be null"); } StatusManager sm = context.getStatusManager(); if (sm == null) { ps.println("WARN: Context named \"" + context.getName() + "\" has no status manager"); } else { StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.getHighestLevel(threshold) >= ErrorStatus.WARN) { print(sm, threshold); } } }
/** * Print the contents of the context statuses, but only if they contain * errors. * * @param context */ public static void printIfErrorsOccured(Context context) { if (context == null) { throw new IllegalArgumentException("Context argument cannot be null"); } StatusManager sm = context.getStatusManager(); if (sm == null) { ps.println("WARN: Context named \"" + context.getName() + "\" has no status manager"); } else { StatusUtil statusUtil = new StatusUtil(context); if (statusUtil.getHighestLevel(0) == ErrorStatus.ERROR) { print(sm); } } }
public void body(InterpretationContext ec, String body) { String finalBody = ec.subst(body); addInfo("Setting logger context name as [" + finalBody + "]"); try { context.setName(finalBody); } catch (IllegalStateException e) { addError("Failed to rename context [" + context.getName() + "] as [" + finalBody + "]", e); } }
String contextName = context.getName(); String contextNameAttributeVal = attributes .getValue(CONTEXT_NAME_ATTRIBUTE_NAME);
@Override public String toString() { return this.getClass().getName() + "(" + context.getName() + ")"; } }
@Override public String toString() { return this.getClass().getName() + "(" + context.getName() + ")"; } }
@Override public String toString() { return this.getClass().getName() + "(" + context.getName() + ")"; } }
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); } }
public void body(InterpretationContext ec, String body) { String finalBody = ec.subst(body); addInfo("Setting logger context name as [" + finalBody + "]"); try { context.setName(finalBody); } catch (IllegalStateException e) { addError("Failed to rename context [" + context.getName() + "] as [" + finalBody + "]", e); } }
public void body(InterpretationContext ec, String body) { String finalBody = ec.subst(body); addInfo("Setting logger context name as [" + finalBody + "]"); try { context.setName(finalBody); } catch (IllegalStateException e) { addError("Failed to rename context [" + context.getName() + "] as [" + finalBody + "]", e); } }
public void body(InterpretationContext ec, String body) { String finalBody = ec.subst(body); addInfo("Setting logger context name as [" + finalBody + "]"); try { context.setName(finalBody); } catch (IllegalStateException e) { addError("Failed to rename context [" + context.getName() + "] as [" + finalBody + "]", e); } }
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(); }