Class Rfc5424Layout.Rfc5424LayoutBuilder
- All Implemented Interfaces:
Builder<Rfc5424Layout>
- Enclosing class:
Rfc5424Layout
- Since:
- 2.21.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe value to use as theAPP-NAMEin the RFC 5424 syslog record.private StringThe enterprise number to include inSD-IDidentifiers.private IntegerThe enterprise number to include inSD-IDidentifiers.private StringSame asnewLineEscape.private StringA prefix to add to event key names when formattingStructuredDataMessagefields.private StringThe pattern used to format exceptions appended to the syslog message.private StringSame asmdcExcludes.private FacilityThe name of theFacilityas described in RFC 5424private StringThe defaultSD-IDas described in RFC 5424.private booleanIndicates whether data from the context map will be included as RFC 5424SD-ELEMENT.private booleanSame asnewLine.private StringSame asmdcIncludes.private LoggerFields[]Optional additionalSD-ELEMENTs.private StringA comma separated list of MDC keys that should be excluded from the LogEvent.private StringThe id to use for the MDC Structured Data Element.private StringA comma separated list of MDC keys that should be included in the LogEvent.private StringA prefix to add to MDC key names when formatting them as structured data parameters.private StringA comma separated list of MDC keys that must be present in the MDC.private StringThe default value to be used in theMSGIDfield of RFC 5424 syslog records.private booleanIftrue, a newline will be appended to the end of the syslog record.private StringIf set, this string will be used to replace new lines within the message text.private StringSame asmdcRequired.private booleanIf true the message will be formatted according to RFC 5425.private booleanSame asuseTlsMessageFormat. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the object after all configuration has been set.setAppName(String appName) setCharset(Charset charset) setConfig(Configuration config) Deprecated.setEnterpriseNumber(Integer enterpriseNumber) setEscapeNL(String escapeNL) Deprecated.Since 2.26.0 usesetNewLineEscape(java.lang.String)instead.setEventPrefix(String eventPrefix) setExceptionPattern(String exceptionPattern) setExcludes(String excludes) Deprecated.since 2.26.0 usesetMdcExcludes(java.lang.String)insteadsetFacility(Facility facility) setIncludeMDC(boolean includeMDC) setIncludeNL(boolean includeNL) Deprecated.Since 2.26.0 usesetNewLine(boolean)instead.setIncludes(String includes) Deprecated.since 2.26.0 usesetMdcIncludes(java.lang.String)insteadsetLoggerFields(LoggerFields[] loggerFields) setMdcExcludes(String mdcExcludes) setMdcIncludes(String mdcIncludes) setMdcPrefix(String mdcPrefix) setMdcRequired(String mdcRequired) setMessageId(String messageId) setNewLine(boolean newLine) setNewLineEscape(String newLineEscape) setRequired(String required) Deprecated.since 2.26.0 usesetMdcRequired(java.lang.String)insteadsetUseTlsMessageFormat(boolean useTlsMessageFormat) setUseTLSMessageFormat(boolean useTLSMessageFormat) Deprecated.since 2.26.0 usesetUseTlsMessageFormat(boolean)insteadMethods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder
getCharset, getFooterSerializer, getHeaderSerializer, setFooterSerializer, setHeaderSerializerMethods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout.Builder
asBuilder, getConfiguration, getFooter, getHeader, setConfiguration, setFooter, setHeaderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
Field Details
-
facility
The name of theFacilityas described in RFC 5424The matching is case-insensitive. Defaults to
LOCAL0. -
id
The defaultSD-IDas described in RFC 5424. -
ein
The enterprise number to include inSD-IDidentifiers.Can contain multiple integers separated by a dot, for example
32473.1Defaults to 32473.
-
enterpriseNumber
The enterprise number to include inSD-IDidentifiers.Limited to a single integer.
Defaults to 32473.
-
includeMDC
Indicates whether data from the context map will be included as RFC 5424SD-ELEMENT.Defaults to
true. -
newLine
Iftrue, a newline will be appended to the end of the syslog record.Default is
false. -
includeNL
Same asnewLine.Erroneously introduced in version 2.21.0, but kept for compatibility.
-
newLineEscape
If set, this string will be used to replace new lines within the message text.By default, new lines are not escaped.
-
escapeNL
Same asnewLineEscape.Erroneously introduced in version 2.21.0, but kept for compatibility.
-
mdcId
The id to use for the MDC Structured Data Element.Defaults to "mdc".
-
mdcPrefix
A prefix to add to MDC key names when formatting them as structured data parameters. -
eventPrefix
A prefix to add to event key names when formattingStructuredDataMessagefields. -
appName
The value to use as theAPP-NAMEin the RFC 5424 syslog record. -
messageId
The default value to be used in theMSGIDfield of RFC 5424 syslog records.If the log event contains a
StructuredDataMessage, the id from that message will be used instead. -
mdcExcludes
A comma separated list of MDC keys that should be excluded from the LogEvent.Mutually exclusive with
mdcIncludes. -
excludes
Same asmdcExcludes.Erroneously introduced in version 2.21.0, but kept for compatibility.
-
mdcIncludes
A comma separated list of MDC keys that should be included in the LogEvent.Mutually exclusive with
mdcExcludes. -
includes
Same asmdcIncludes.Erroneously introduced in version 2.21.0, but kept for compatibility.
-
mdcRequired
A comma separated list of MDC keys that must be present in the MDC. -
required
Same asmdcRequired.Erroneously introduced in version 2.21.0, but kept for compatibility.
-
exceptionPattern
The pattern used to format exceptions appended to the syslog message. -
useTlsMessageFormat
If true the message will be formatted according to RFC 5425.Default is
false. -
useTLSMessageFormat
Same asuseTlsMessageFormat.Erroneously introduced in version 2.21.0, but kept for compatibility.
-
loggerFields
Optional additionalSD-ELEMENTs.Each
LoggerFieldsentry contains a set of key/value patterns to produce structured data parameters.
-
-
Constructor Details
-
Rfc5424LayoutBuilder
public Rfc5424LayoutBuilder()
-
-
Method Details
-
setConfig
Deprecated.Since 2.24.0 useAbstractLayout.Builder.setConfiguration(org.apache.logging.log4j.core.config.Configuration)instead. -
setFacility
-
setId
-
setEin
-
setIncludeMDC
-
setIncludeNL
Deprecated.Since 2.26.0 usesetNewLine(boolean)instead. -
setNewLine
- Since:
- 2.26.0
-
setEscapeNL
Deprecated.Since 2.26.0 usesetNewLineEscape(java.lang.String)instead. -
setNewLineEscape
- Since:
- 2.26.0
-
setMdcId
-
setMdcPrefix
-
setEventPrefix
-
setAppName
-
setMessageId
-
setExcludes
Deprecated.since 2.26.0 usesetMdcExcludes(java.lang.String)instead -
setMdcExcludes
- Since:
- 2.26.0
-
setIncludes
Deprecated.since 2.26.0 usesetMdcIncludes(java.lang.String)instead -
setMdcIncludes
- Since:
- 2.26.0
-
setRequired
Deprecated.since 2.26.0 usesetMdcRequired(java.lang.String)instead -
setMdcRequired
- Since:
- 2.26.0
-
setCharset
- Overrides:
setCharsetin classAbstractStringLayout.Builder<Rfc5424Layout.Rfc5424LayoutBuilder>
-
setExceptionPattern
-
setUseTLSMessageFormat
@Deprecated public Rfc5424Layout.Rfc5424LayoutBuilder setUseTLSMessageFormat(boolean useTLSMessageFormat) Deprecated.since 2.26.0 usesetUseTlsMessageFormat(boolean)instead -
setUseTlsMessageFormat
- Since:
- 2.26.0
-
setLoggerFields
-
setEnterpriseNumber
- Since:
- 2.25.0
-
build
Description copied from interface:BuilderBuilds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
buildin interfaceBuilder<Rfc5424Layout>- Returns:
- the configured instance.
-
AbstractLayout.Builder.setConfiguration(org.apache.logging.log4j.core.config.Configuration)instead.