inError = true;
addError(errMsg);
return;
}
Logger logger = (Logger) o;
String appenderName = ec.subst(attributes.getValue(ActionConst.REF_ATTRIBUTE));
if (OptionHelper.isEmpty(appenderName)) {
// print a meaningful error message and return
String errMsg = "Missing appender ref attribute in <appender-ref> tag.";
inError = true;
addError(errMsg);
return;
}
@SuppressWarnings("unchecked")
Map<String, Set<String>> appenderBag =
(Map<String, Set<String>>) ec.getObjectMap().get(OSGI_APPENDER_REF_BAG);
if(appenderBag == null){
appenderBag = new HashMap<String, Set<String>>();
ec.getObjectMap().put(OSGI_APPENDER_REF_BAG,appenderBag);
}
Set<String> loggers = appenderBag.get(appenderName);
if(loggers == null){
loggers = new HashSet<String>();
appenderBag.put(appenderName,loggers);
}
loggers.add(logger.getName());
}