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 ec, String name, Attributes attributes) { // See LBCLASSIC-225 (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 = System.getProperty(DEBUG_SYSTEM_PROPERTY_KEY); if (debugAttrib == null) { debugAttrib = attributes.getValue(INTERNAL_DEBUG_ATTR); } if (OptionHelper.isEmpty(debugAttrib) || debugAttrib.equals("false") || debugAttrib.equals("null")) { addInfo(INTERNAL_DEBUG_ATTR + " attribute not set"); } else { StatusListenerConfigHelper.addOnConsoleListenerInstance(context, new OnConsoleStatusListener()); } // the context is appender attachable, so it is pushed on top of the stack ec.pushObject(getContext()); }
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) { // See LBCLASSIC-225 (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 = OptionHelper.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); ContextUtil contextUtil = new ContextUtil(context); contextUtil.addHostNameAsProperty(); // the context is turbo filter attachable, so it is pushed on top of the // stack ic.pushObject(getContext()); LoggerContext lc = (LoggerContext) context; boolean packagingData = OptionHelper.toBoolean( ic.subst(attributes.getValue(PACKAGING_DATA_ATTR)), LoggerContext.DEFAULT_PACKAGING_DATA); lc.setPackagingDataEnabled(packagingData); }
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()); }
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()); }
@Before @Override public void setUp() throws ParseException { super.setUp(); StatusListenerConfigHelper.addOnConsoleListenerInstance(context, new OnConsoleStatusListener()); delayingShutdownHook.setContext(context); initRFA(rfa); }
@Test public void addOnConsoleListenerInstanceShouldNotStartSecondListener() { OnConsoleStatusListener ocl0 = new OnConsoleStatusListener(); OnConsoleStatusListener ocl1 = new OnConsoleStatusListener(); StatusListenerConfigHelper.addOnConsoleListenerInstance(context, ocl0); { List<StatusListener> listeners = sm.getCopyOfStatusListenerList(); assertEquals(1, listeners.size()); assertTrue(ocl0.isStarted()); } // second listener should not have been started StatusListenerConfigHelper.addOnConsoleListenerInstance(context, ocl1); { List<StatusListener> listeners = sm.getCopyOfStatusListenerList(); assertEquals(1, listeners.size()); assertFalse(ocl1.isStarted()); } }
StatusListenerConfigHelper.addOnConsoleListenerInstance(this, new OnConsoleStatusListener());