@Plugin(name="Rfc5424Layout", category="Core", elementType="layout", printObject=true) public final class Rfc5424Layout extends AbstractStringLayout
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_ENTERPRISE_NUMBER
Not a very good default - it is the Apache Software Foundation's enterprise number.
|
static String |
DEFAULT_ID
The default event id.
|
static String |
DEFAULT_MDCID |
static Pattern |
NEWLINE_PATTERN
Match newlines in a platform-independent manner.
|
static Pattern |
PARAM_VALUE_ESCAPE_PATTERN
Match characters which require escaping
|
footer, header, LOGGER
ELEMENT_TYPE
Modifier and Type | Method and Description |
---|---|
static Rfc5424Layout |
createLayout(Facility facility,
String id,
int enterpriseNumber,
boolean includeMDC,
String mdcId,
String mdcPrefix,
String eventPrefix,
boolean newLine,
String escapeNL,
String appName,
String msgId,
String excludes,
String includes,
String required,
String exceptionPattern,
boolean useTlsMessageFormat,
LoggerFields[] loggerFields,
Configuration config)
Create the RFC 5424 Layout.
|
Map<String,String> |
getContentFormat()
Gets this Rfc5424Layout's content format.
|
protected List<String> |
getMdcExcludes() |
protected List<String> |
getMdcIncludes() |
protected String |
getProcId() |
String |
toSerializable(LogEvent event)
Formats a
LogEvent in conformance with the RFC 5424 Syslog specification. |
String |
toString() |
getBytes, getCharset, getContentType, toByteArray
getFooter, getHeader
public static final int DEFAULT_ENTERPRISE_NUMBER
public static final String DEFAULT_ID
public static final Pattern NEWLINE_PATTERN
public static final Pattern PARAM_VALUE_ESCAPE_PATTERN
public static final String DEFAULT_MDCID
public Map<String,String> getContentFormat()
getContentFormat
in interface Layout<String>
getContentFormat
in class AbstractLayout<String>
public String toSerializable(LogEvent event)
LogEvent
in conformance with the RFC 5424 Syslog specification.event
- The LogEvent.protected List<String> getMdcExcludes()
protected List<String> getMdcIncludes()
@PluginFactory public static Rfc5424Layout createLayout(@PluginAttribute(value="facility",defaultString="LOCAL0") Facility facility, @PluginAttribute(value="id") String id, @PluginAttribute(value="enterpriseNumber",defaultInt=18060) int enterpriseNumber, @PluginAttribute(value="includeMDC",defaultBoolean=true) boolean includeMDC, @PluginAttribute(value="mdcId",defaultString="mdc") String mdcId, @PluginAttribute(value="mdcPrefix") String mdcPrefix, @PluginAttribute(value="eventPrefix") String eventPrefix, @PluginAttribute(value="newLine",defaultBoolean=false) boolean newLine, @PluginAttribute(value="newLineEscape") String escapeNL, @PluginAttribute(value="appName") String appName, @PluginAttribute(value="messageId") String msgId, @PluginAttribute(value="mdcExcludes") String excludes, @PluginAttribute(value="mdcIncludes") String includes, @PluginAttribute(value="mdcRequired") String required, @PluginAttribute(value="exceptionPattern") String exceptionPattern, @PluginAttribute(value="useTlsMessageFormat",defaultBoolean=false) boolean useTlsMessageFormat, @PluginElement(value="LoggerFields") LoggerFields[] loggerFields, @PluginConfiguration Configuration config)
facility
- The Facility is used to try to classify the message.id
- The default structured data id to use when formatting according to RFC 5424.enterpriseNumber
- The IANA enterprise number.includeMDC
- Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslog
record. Defaults to "true:.mdcId
- The id to use for the MDC Structured Data Element.mdcPrefix
- The prefix to add to MDC key names.eventPrefix
- The prefix to add to event key names.newLine
- If true, a newline will be appended to the end of the syslog record. The default is false.escapeNL
- String that should be used to replace newlines within the message text.appName
- The value to use as the APP-NAME in the RFC 5424 syslog record.msgId
- The default value to be used in the MSGID field of RFC 5424 syslog records.excludes
- A comma separated list of MDC keys that should be excluded from the LogEvent.includes
- A comma separated list of MDC keys that should be included in the FlumeEvent.required
- A comma separated list of MDC keys that must be present in the MDC.exceptionPattern
- The pattern for formatting exceptions.useTlsMessageFormat
- If true the message will be formatted according to RFC 5425.loggerFields
- Container for the KeyValuePairs containing the patternsconfig
- The Configuration. Some Converters require access to the Interpolator.Copyright © 1999-2021 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.