final Configuration config) {
final Map<String, FieldFormatter> sdIdMap = new HashMap<String, FieldFormatter>();
if (loggerFields != null) {
for (final LoggerFields lField : loggerFields) {
final StructuredDataId key = lField.getSdId() == null ? mdcSDID : lField.getSdId();
final Map<String, List<PatternFormatter>> sdParams = new HashMap<String, List<PatternFormatter>>();
final Map<String, String> fields = lField.getMap();
if (!fields.isEmpty()) {
final PatternParser fieldParser = createPatternParser(config, null);
for (final Map.Entry<String, String> entry : fields.entrySet()) {
final List<PatternFormatter> formatters = fieldParser.parse(entry.getValue(), false);
sdParams.put(entry.getKey(), formatters);
}
final FieldFormatter fieldFormatter = new FieldFormatter(sdParams,
lField.getDiscardIfAllFieldsAreEmpty());
sdIdMap.put(key.toString(), fieldFormatter);
}
}
}
return sdIdMap.size() > 0 ? sdIdMap : null;
}