inError = true;
addError(errMsg);
return;
}
AppenderAttachable appenderAttachable = (AppenderAttachable) 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;
}
HashMap appenderBag = (HashMap) ec.getObjectMap().get(
ActionConst.APPENDER_BAG);
Appender appender = (Appender) appenderBag.get(appenderName);
if (appender == null) {
String msg = "Could not find an appender named [" + appenderName
+ "]. Did you define it below instead of above in the configuration file?";
inError = true;
addError(msg);
addError("See " + CoreConstants.CODES_URL
+ "#appender_order for more details.");
return;
}
addInfo("Attaching appender named [" + appenderName + "] to "
+ appenderAttachable);
appenderAttachable.addAppender(appender);
}