@Test public void nullMDC() { event = new LoggingEvent("a", logger, Level.DEBUG, "", null, null); assertTrue(event.getMDCPropertyMap().isEmpty()); String discriminatorValue = discriminator.getDiscriminatingValue(event); assertEquals(DEFAULT_VAL, discriminatorValue); }
public String getDiscriminatingValue(ILoggingEvent event) { Map<String, String> mdcMap = event.getMDCPropertyMap(); if (mdcMap == null) { return defaultValue; } String mdcValue = mdcMap.get(key); if (mdcValue == null) { return defaultValue; } else { return mdcValue; } }
MDCBasedDiscriminator extends AbstractDiscriminator<ILoggingEvent> { public String getDiscriminatingValue(ILoggingEvent event) { Map<String, String> mdcMap = event.getMDCPropertyMap(); if (mdcMap == null) { return defaultValue; } String mdcValue = mdcMap.get(key); if (mdcValue == null) { return defaultValue; } else { return mdcValue; } } }
MDCBasedDiscriminator extends AbstractDiscriminator<ILoggingEvent> { public String getDiscriminatingValue(ILoggingEvent event) { Map<String, String> mdcMap = event.getMDCPropertyMap(); if (mdcMap == null) { return defaultValue; } String mdcValue = mdcMap.get(key); if (mdcValue == null) { return defaultValue; } else { return mdcValue; } }  }
MDCBasedDiscriminator extends AbstractDiscriminator<ILoggingEvent> { public String getDiscriminatingValue(ILoggingEvent event) { Map<String, String> mdcMap = event.getMDCPropertyMap(); if (mdcMap == null) { return defaultValue; } String mdcValue = mdcMap.get(key); if (mdcValue == null) { return defaultValue; } else { return mdcValue; } }  String getDiscriminatingValue(ILoggingEvent event); @Override void start(); String getKey(); void setKey(String key); String getDefaultValue(); void setDefaultValue(String defaultValue); }
MDCBasedDiscriminator extends AbstractDiscriminator<ILoggingEvent> { public String getDiscriminatingValue(ILoggingEvent event) { Map<String, String> mdcMap = event.getMDCPropertyMap(); if (mdcMap == null) { return defaultValue; } String mdcValue = mdcMap.get(key); if (mdcValue == null) { return defaultValue; } else { return mdcValue; } }  String getDiscriminatingValue(ILoggingEvent event); @Override void start(); String getKey(); void setKey(String key); String getDefaultValue(); void setDefaultValue(String defaultValue);  }