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[]additionalFieldsprivate booleancompactprivate booleancompleteprivate java.lang.StringendOfLineprivate booleaneventEolprivate booleanincludeNullDelimiterprivate booleanincludeStacktraceprivate booleanincludeTimeMillisprivate booleanlocationInfoprivate booleanpropertiesprivate booleanstacktraceAsString
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyValuePair[]getAdditionalFields()java.lang.StringgetEndOfLine()booleangetEventEol()booleanisCompact()booleanisComplete()booleanisIncludeNullDelimiter()booleanisIncludeStacktrace()If "true", includes the stacktrace of any Throwable in the generated data, defaults to "true".booleanisIncludeTimeMillis()booleanisLocationInfo()booleanisProperties()booleanisStacktraceAsString()BsetAdditionalFields(KeyValuePair[] additionalFields)Additional fields to set on each log event.BsetCompact(boolean compact)BsetComplete(boolean complete)BsetEndOfLine(java.lang.String endOfLine)BsetEventEol(boolean eventEol)BsetIncludeNullDelimiter(boolean includeNullDelimiter)Whether to include NULL byte as delimiter after each event (optional, default to false).BsetIncludeStacktrace(boolean includeStacktrace)If "true", includes the stacktrace of any Throwable in the generated JSON, defaults to "true".BsetIncludeTimeMillis(boolean includeTimeMillis)Whether to include the timestamp (in addition to the Instant) (optional, default to false).BsetLocationInfo(boolean locationInfo)BsetProperties(boolean properties)BsetStacktraceAsString(boolean stacktraceAsString)Whether to format the stacktrace as a string, and not a nested object (optional, defaults to false).protected java.lang.StringtoStringOrNull(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
-
-