// FIXME: What happens if the users wanted to set the additivity flag
// for "org.apahce.log4j" to false in the config file? We are now
// potentially overriding her wishes but I don't see any other way.
ll.setAdditivity(true);
ListAppender listAppender = (ListAppender) ll.getAppender(Constants.TEMP_LIST_APPENDER_NAME);
if(listAppender == null) {
String errMsg = "Could not find appender "+Constants.TEMP_LIST_APPENDER_NAME;
getLogger(repository).error(errMsg);
addError(new ErrorItem(errMsg));
return;
}
List eventList = listAppender.getList();
int size = eventList.size();
for(int i = 0; i < size; i++) {
LoggingEvent event = (LoggingEvent) eventList.get(i);
Logger xLogger = event.getLogger();
if (event.getLevel().isGreaterOrEqual(xLogger.getEffectiveLevel())) {
xLogger.callAppenders(event);
}
}
listAppender.clearList();
listAppender.close();
ll.removeAppender(listAppender);
}