String pattern = foundationMarker.getFormatter().getFormat(foundationLof4jLoggingEvent.getAppenderName());
if (pattern != null) { // only if we have pattern from one of
// two options
if (layoutsMap.get(pattern) == null) {
layoutsMap.put(pattern, new FoundationLoggingPatternLayout(pattern));
}
// get the layout from static layouts map and get its format
// string.
String fromInnerPattern = layoutsMap.get(pattern).format(event);
toAppendTo.append(fromInnerPattern);