return (events);
}
public static Collection<String> getLoggingMessages(RingBufferAppender...appenders) {
List<LoggingEvent> events = new ArrayList<LoggingEvent>();
Layout layout = null;
for (RingBufferAppender rba : appenders) {
LoggingEvent e[] = rba.getLogEvents();
if (LOG.isDebugEnabled())
LOG.debug("Got " + e.length + " LoggingEvents for " + rba);
CollectionUtil.addAll(events, e);
if (layout == null) layout = rba.getLayout();
} // FOR
if (events.isEmpty() == false) assert(layout != null);
Collections.sort(events, new Comparator<LoggingEvent>() {
@Override
public int compare(LoggingEvent o1, LoggingEvent o2) {
return (int)(o1.timeStamp - o2.timeStamp);
}
});
List<String> messages = new ArrayList<String>();
for (LoggingEvent event : events) {
messages.add(layout.format(event));
} // FOR
return (messages);
}