Class JsonLayout.Builder<B extends JsonLayout.Builder<B>>
java.lang.Object
org.apache.logging.log4j.core.layout.AbstractLayout.Builder<B>
org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B>
org.apache.logging.log4j.core.layout.AbstractJacksonLayout.Builder<B>
org.apache.logging.log4j.core.layout.JsonLayout.Builder<B>
- All Implemented Interfaces:
Builder<JsonLayout>
- Enclosing class:
- JsonLayout
public static class JsonLayout.Builder<B extends JsonLayout.Builder<B>>
extends org.apache.logging.log4j.core.layout.AbstractJacksonLayout.Builder<B>
implements Builder<JsonLayout>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the object after all configuration has been set.boolean
boolean
setAdditionalFields
(KeyValuePair[] additionalFields) Additional fields to set on each log event.setObjectMessageAsJsonObject
(boolean objectMessageAsJsonObject) setPropertiesAsList
(boolean propertiesAsList) Methods inherited from class org.apache.logging.log4j.core.layout.AbstractJacksonLayout.Builder
getEndOfLine, getEventEol, isCompact, isComplete, isIncludeNullDelimiter, isIncludeStacktrace, isIncludeTimeMillis, isLocationInfo, isProperties, isStacktraceAsString, setCompact, setComplete, setEndOfLine, setEventEol, setIncludeNullDelimiter, setIncludeStacktrace, setIncludeTimeMillis, setLocationInfo, setProperties, setStacktraceAsString, toStringOrNull
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder
getCharset, getFooterSerializer, getHeaderSerializer, setCharset, setFooterSerializer, setHeaderSerializer
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout.Builder
asBuilder, getConfiguration, getFooter, getHeader, setConfiguration, setFooter, setHeader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Description copied from interface:Builder
Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
build
in interfaceBuilder<B extends JsonLayout.Builder<B>>
- Returns:
- the configured instance.
-
isPropertiesAsList
public boolean isPropertiesAsList() -
setPropertiesAsList
-
getObjectMessageAsJsonObject
public boolean getObjectMessageAsJsonObject() -
setObjectMessageAsJsonObject
-
getAdditionalFields
- Overrides:
getAdditionalFields
in classorg.apache.logging.log4j.core.layout.AbstractJacksonLayout.Builder<B extends JsonLayout.Builder<B>>
-
setAdditionalFields
Description copied from class:org.apache.logging.log4j.core.layout.AbstractJacksonLayout.Builder
Additional fields to set on each log event.- Overrides:
setAdditionalFields
in classorg.apache.logging.log4j.core.layout.AbstractJacksonLayout.Builder<B extends JsonLayout.Builder<B>>
- Returns:
- this builder
-