final String mdcPrefix, final String eventPrefix,
final String appName, final String messageId, final String excludes, final String includes,
final String required, final Charset charset, final String exceptionPattern,
final Map<String, String> loggerFields) {
super(charset);
final PatternParser exceptionParser = createPatternParser(config, ThrowablePatternConverter.class);
exceptionFormatters = exceptionPattern == null ? null : exceptionParser.parse(exceptionPattern, false);
this.facility = facility;
this.defaultId = id == null ? DEFAULT_ID : id;
this.enterpriseNumber = ein;
this.includeMDC = includeMDC;
this.includeNewLine = includeNL;
this.escapeNewLine = escapeNL == null ? null : Matcher.quoteReplacement(escapeNL);
this.mdcId = mdcId;
this.mdcPrefix = mdcPrefix;
this.eventPrefix = eventPrefix;
this.appName = appName;
this.messageId = messageId;
this.localHostName = NetUtils.getLocalHostname();
ListChecker c = null;
if (excludes != null) {
final String[] array = excludes.split(",");
if (array.length > 0) {
c = new ExcludeChecker();
mdcExcludes = new ArrayList<String>(array.length);
for (final String str : array) {
mdcExcludes.add(str.trim());
}
} else {
mdcExcludes = null;
}
} else {
mdcExcludes = null;
}
if (includes != null) {
final String[] array = includes.split(",");
if (array.length > 0) {
c = new IncludeChecker();
mdcIncludes = new ArrayList<String>(array.length);
for (final String str : array) {
mdcIncludes.add(str.trim());
}
} else {
mdcIncludes = null;
}
} else {
mdcIncludes = null;
}
if (required != null) {
final String[] array = required.split(",");
if (array.length > 0) {
mdcRequired = new ArrayList<String>(array.length);
for (final String str : array) {
mdcRequired.add(str.trim());
}
} else {
mdcRequired = null;
}
} else {
mdcRequired = null;
}
this.checker = c != null ? c : noopChecker;
final String name = config == null ? null : config.getName();
configName = name != null && name.length() > 0 ? name : null;
if (loggerFields != null && !loggerFields.isEmpty()) {
final PatternParser fieldParser = createPatternParser(config, null);
final Map<String, List<PatternFormatter>> map = new HashMap<String, List<PatternFormatter>>();
for (final Map.Entry<String, String> entry : loggerFields.entrySet()) {
final List<PatternFormatter> formatters = fieldParser.parse(entry.getValue(), false);
map.put(entry.getKey(), formatters);
}
this.fieldFormatters = map;
} else {
this.fieldFormatters = null;