Class AbstractJacksonLayout.Builder<B extends AbstractJacksonLayout.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>
-
- Direct Known Subclasses:
JsonLayout.Builder
,XmlLayout.Builder
,YamlLayout.Builder
- Enclosing class:
- AbstractJacksonLayout
public abstract static class AbstractJacksonLayout.Builder<B extends AbstractJacksonLayout.Builder<B>> extends AbstractStringLayout.Builder<B>
-
-
Field Summary
Fields Modifier and Type Field Description private KeyValuePair[]
additionalFields
private boolean
compact
private boolean
complete
private java.lang.String
endOfLine
private boolean
eventEol
private boolean
includeNullDelimiter
private boolean
includeStacktrace
private boolean
includeTimeMillis
private boolean
locationInfo
private boolean
properties
private boolean
stacktraceAsString
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyValuePair[]
getAdditionalFields()
java.lang.String
getEndOfLine()
boolean
getEventEol()
boolean
isCompact()
boolean
isComplete()
boolean
isIncludeNullDelimiter()
boolean
isIncludeStacktrace()
If "true", includes the stacktrace of any Throwable in the generated data, defaults to "true".boolean
isIncludeTimeMillis()
boolean
isLocationInfo()
boolean
isProperties()
boolean
isStacktraceAsString()
B
setAdditionalFields(KeyValuePair[] additionalFields)
Additional fields to set on each log event.B
setCompact(boolean compact)
B
setComplete(boolean complete)
B
setEndOfLine(java.lang.String endOfLine)
B
setEventEol(boolean eventEol)
B
setIncludeNullDelimiter(boolean includeNullDelimiter)
Whether to include NULL byte as delimiter after each event (optional, default to false).B
setIncludeStacktrace(boolean includeStacktrace)
If "true", includes the stacktrace of any Throwable in the generated JSON, defaults to "true".B
setIncludeTimeMillis(boolean includeTimeMillis)
Whether to include the timestamp (in addition to the Instant) (optional, default to false).B
setLocationInfo(boolean locationInfo)
B
setProperties(boolean properties)
B
setStacktraceAsString(boolean stacktraceAsString)
Whether to format the stacktrace as a string, and not a nested object (optional, defaults to false).protected java.lang.String
toStringOrNull(byte[] header)
-
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
-
-
-
-
Field Detail
-
eventEol
@PluginBuilderAttribute private boolean eventEol
-
endOfLine
@PluginBuilderAttribute private java.lang.String endOfLine
-
compact
@PluginBuilderAttribute private boolean compact
-
complete
@PluginBuilderAttribute private boolean complete
-
locationInfo
@PluginBuilderAttribute private boolean locationInfo
-
properties
@PluginBuilderAttribute private boolean properties
-
includeStacktrace
@PluginBuilderAttribute private boolean includeStacktrace
-
stacktraceAsString
@PluginBuilderAttribute private boolean stacktraceAsString
-
includeNullDelimiter
@PluginBuilderAttribute private boolean includeNullDelimiter
-
includeTimeMillis
@PluginBuilderAttribute private boolean includeTimeMillis
-
additionalFields
@PluginElement("AdditionalField") private KeyValuePair[] additionalFields
-
-
Method Detail
-
toStringOrNull
protected java.lang.String toStringOrNull(byte[] header)
-
getEventEol
public boolean getEventEol()
-
getEndOfLine
public java.lang.String getEndOfLine()
-
isCompact
public boolean isCompact()
-
isComplete
public boolean isComplete()
-
isLocationInfo
public boolean isLocationInfo()
-
isProperties
public boolean isProperties()
-
isIncludeStacktrace
public boolean isIncludeStacktrace()
If "true", includes the stacktrace of any Throwable in the generated data, defaults to "true".- Returns:
- If "true", includes the stacktrace of any Throwable in the generated data, defaults to "true".
-
isStacktraceAsString
public boolean isStacktraceAsString()
-
isIncludeNullDelimiter
public boolean isIncludeNullDelimiter()
-
isIncludeTimeMillis
public boolean isIncludeTimeMillis()
-
getAdditionalFields
public KeyValuePair[] getAdditionalFields()
-
setEventEol
public B setEventEol(boolean eventEol)
-
setEndOfLine
public B setEndOfLine(java.lang.String endOfLine)
-
setCompact
public B setCompact(boolean compact)
-
setComplete
public B setComplete(boolean complete)
-
setLocationInfo
public B setLocationInfo(boolean locationInfo)
-
setProperties
public B setProperties(boolean properties)
-
setIncludeStacktrace
public B setIncludeStacktrace(boolean includeStacktrace)
If "true", includes the stacktrace of any Throwable in the generated JSON, defaults to "true".- Parameters:
includeStacktrace
- If "true", includes the stacktrace of any Throwable in the generated JSON, defaults to "true".- Returns:
- this builder
-
setStacktraceAsString
public B setStacktraceAsString(boolean stacktraceAsString)
Whether to format the stacktrace as a string, and not a nested object (optional, defaults to false).- Returns:
- this builder
-
setIncludeNullDelimiter
public B setIncludeNullDelimiter(boolean includeNullDelimiter)
Whether to include NULL byte as delimiter after each event (optional, default to false).- Returns:
- this builder
-
setIncludeTimeMillis
public B setIncludeTimeMillis(boolean includeTimeMillis)
Whether to include the timestamp (in addition to the Instant) (optional, default to false).- Returns:
- this builder
-
setAdditionalFields
public B setAdditionalFields(KeyValuePair[] additionalFields)
Additional fields to set on each log event.- Returns:
- this builder
-
-