Charset c = Charset.isSupported("UTF-8") ? Charset.forName("UTF-8") : Charset.defaultCharset();
if (charset != null) {
if (Charset.isSupported(charset)) {
c = Charset.forName(charset);
} else {
LOGGER.error("Charset " + charset + " is not supported for layout, using " + c.displayName());
}
}
Layout layout = (format.equalsIgnoreCase(RFC5424)) ?
RFC5424Layout.createLayout(facility, id, ein, includeMDC, mdcId, includeNL, appName, msgId,
excludes, includes, required, charset, config) :