public void begin(InterpretationContext ec, String name, Attributes attributes) { inError = false; LoggerContext loggerContext = (LoggerContext) this.context; root = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME); String levelStr = ec.subst(attributes.getValue(ActionConst.LEVEL_ATTRIBUTE)); if (!OptionHelper.isEmpty(levelStr)) { Level level = Level.toLevel(levelStr); addInfo("Setting level of ROOT logger to " + level); root.setLevel(level); } ec.pushObject(root); }
@Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { this.depth++; if (this.depth != 1) { return; } ic.pushObject(this); this.acceptsProfile = acceptsProfiles(ic, attributes); this.events = new ArrayList<>(); ic.addInPlayListener(this); }
logger.setAdditive(additive); ec.pushObject(logger);
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Mandatory \"" + CLASS_ATTRIBUTE + "\" attribute not set for <loggerContextListener> element"); inError = true; return; } try { lcl = (LoggerContextListener) OptionHelper.instantiateByClassName(className, LoggerContextListener.class, context); if (lcl instanceof ContextAware) { ((ContextAware) lcl).setContext(context); } ec.pushObject(lcl); addInfo("Adding LoggerContextListener of type [" + className + "] to the object stack"); } catch (Exception oops) { inError = true; addError("Could not create LoggerContextListener of type " + className + "].", oops); } }
public void begin(InterpretationContext ic, String name, Attributes attributes) { threshold = System.currentTimeMillis(); // See LOGBACK-527 (the system property is looked up first. Thus, it overrides // the equivalent property in the config file. This reversal of scope priority is justified // by the use case: the admin trying to chase rogue config file String debugAttrib = getSystemProperty(DEBUG_SYSTEM_PROPERTY_KEY); if (debugAttrib == null) { debugAttrib = ic.subst(attributes.getValue(INTERNAL_DEBUG_ATTR)); } if (OptionHelper.isEmpty(debugAttrib) || debugAttrib.equalsIgnoreCase("false") || debugAttrib.equalsIgnoreCase("null")) { addInfo(INTERNAL_DEBUG_ATTR + " attribute not set"); } else { StatusListenerConfigHelper.addOnConsoleListenerInstance(context, new OnConsoleStatusListener()); } processScanAttrib(ic, attributes); LoggerContext lc = (LoggerContext) context; boolean packagingData = OptionHelper.toBoolean(ic.subst(attributes.getValue(PACKAGING_DATA_ATTR)), LoggerContext.DEFAULT_PACKAGING_DATA); lc.setPackagingDataEnabled(packagingData); if (EnvUtil.isGroovyAvailable()) { ContextUtil contextUtil = new ContextUtil(context); contextUtil.addGroovyPackages(lc.getFrameworkPackages()); } // the context is turbo filter attachable, so it is pushed on top of the // stack ic.pushObject(getContext()); }
@Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for receiver. Near [" + name + "] line " + getLineNumber(ic)); inError = true; return; } try { addInfo("About to instantiate receiver of type [" + className + "]"); receiver = (ReceiverBase) OptionHelper.instantiateByClassName(className, ReceiverBase.class, context); receiver.setContext(context); ic.pushObject(receiver); } catch (Exception ex) { inError = true; addError("Could not create a receiver of type [" + className + "].", ex); throw new ActionException(ex); } }
public void begin(InterpretationContext ec, String name, Attributes attributes) { inError = false; LoggerContext loggerContext = (LoggerContext) this.context; root = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME); String levelStr = ec.subst(attributes.getValue(ActionConst.LEVEL_ATTRIBUTE)); if (!OptionHelper.isEmpty(levelStr)) { Level level = Level.toLevel(levelStr); addInfo("Setting level of ROOT logger to " + level); root.setLevel(level); } ec.pushObject(root); }
logger.setAdditive(additive); ec.pushObject(logger);
@Override public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Mandatory \"" + CLASS_ATTRIBUTE + "\" attribute not set for <loggerContextListener> element"); inError = true; return; } try { lcl = (LoggerContextListener) OptionHelper.instantiateByClassName( className, LoggerContextListener.class, context); if(lcl instanceof ContextAware) { ((ContextAware) lcl).setContext(context); } ec.pushObject(lcl); addInfo("Adding LoggerContextListener of type [" + className + "] to the object stack"); } catch (Exception oops) { inError = true; addError("Could not create LoggerContextListener of type " + className + "].", oops); } }
public void begin(InterpretationContext ic, String name, Attributes attributes) { threshold = System.currentTimeMillis(); // See LOGBACK-527 (the system property is looked up first. Thus, it overrides // the equivalent property in the config file. This reversal of scope priority is justified // by the use case: the admin trying to chase rogue config file String debugAttrib = getSystemProperty(DEBUG_SYSTEM_PROPERTY_KEY); if (debugAttrib == null) { debugAttrib = ic.subst(attributes.getValue(INTERNAL_DEBUG_ATTR)); } if (OptionHelper.isEmpty(debugAttrib) || debugAttrib.equalsIgnoreCase("false") || debugAttrib.equalsIgnoreCase("null")) { addInfo(INTERNAL_DEBUG_ATTR + " attribute not set"); } else { OnConsoleStatusListener.addNewInstanceToContext(context); } processScanAttrib(ic, attributes); ContextUtil contextUtil = new ContextUtil(context); contextUtil.addHostNameAsProperty(); if(EnvUtil.isGroovyAvailable()) { LoggerContext lc = (LoggerContext) context; contextUtil.addGroovyPackages(lc.getFrameworkPackages()); } // the context is turbo filter attachable, so it is pushed on top of the // stack ic.pushObject(getContext()); }
@Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for receiver. Near [" + name + "] line " + getLineNumber(ic)); inError = true; return; } try { addInfo("About to instantiate receiver of type [" + className + "]"); receiver = (ReceiverBase) OptionHelper.instantiateByClassName( className, ReceiverBase.class, context); receiver.setContext(context); ic.pushObject(receiver); } catch (Exception ex) { inError = true; addError("Could not create a receiver of type [" + className + "].", ex); throw new ActionException(ex); } }
ic.pushObject(this); if(!EnvUtil.isJaninoAvailable()) { addError(MISSING_JANINO_MSG);
ec.pushObject(appender); } catch (Exception oops) { inError = true;
((LifeCycle) definer).start(); ec.pushObject(definer); } catch (Exception oops) { inError = true;
ec.pushObject(actionData.getNestedComplexProperty());
public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException { inError = false; String className = attributes.getValue(CLASS_ATTRIBUTE); if (OptionHelper.isEmpty(className)) { addError("Missing class name for statusListener. Near [" + name + "] line " + getLineNumber(ec)); inError = true; return; } try { statusListener = (StatusListener) OptionHelper.instantiateByClassName( className, StatusListener.class, context); ec.getContext().getStatusManager().add(statusListener); if (statusListener instanceof ContextAware) { ((ContextAware) statusListener).setContext(context); } addInfo("Added status listener of type [" + className + "]"); ec.pushObject(statusListener); } catch (Exception e) { inError = true; addError( "Could not create an StatusListener of type [" + className + "].", e); throw new ActionException(e); } }
evaluator.setName(evaluatorName); ec.pushObject(evaluator); addInfo("Adding evaluator named [" + evaluatorName + "] to the object stack");
private URL pushPath(InterpretationContext ic, URL url) { State state = new State(); state.setUrl(url); ic.pushObject(state); return url; } }
public void begin(InterpretationContext ec, String name, Attributes attributes) { inError = false; LoggerContext loggerContext = (LoggerContext) this.context; root = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME); String levelStr = ec.subst(attributes.getValue(ActionConst.LEVEL_ATTRIBUTE)); if (!OptionHelper.isEmpty(levelStr)) { Level level = Level.toLevel(levelStr); addInfo("Setting level of ROOT logger to " + level); root.setLevel(level); } ec.pushObject(root); }
@Override final public void doConfigure(final List<SaxEvent> eventList) throws JoranException { buildInterpreter(); interpreter.getInterpretationContext().pushObject(ff); EventPlayer player = new EventPlayer(interpreter); player.play(eventList); }