Builder<GelfLayout>
public static class GelfLayout.Builder<B extends GelfLayout.Builder<B>> extends AbstractStringLayout.Builder<B> implements Builder<GelfLayout>
Constructor | Description |
---|---|
Builder() |
Modifier and Type | Method | Description |
---|---|---|
GelfLayout |
build() |
Builds the object after all configuration has been set.
|
KeyValuePair[] |
getAdditionalFields() |
|
int |
getCompressionThreshold() |
|
GelfLayout.CompressionType |
getCompressionType() |
|
String |
getHost() |
|
boolean |
isIncludeNullDelimiter() |
|
boolean |
isIncludeStacktrace() |
|
boolean |
isIncludeThreadContext() |
|
B |
setAdditionalFields(KeyValuePair[] additionalFields) |
Additional fields to set on each log event.
|
B |
setCompressionThreshold(int compressionThreshold) |
Compress if data is larger than this number of bytes (optional, defaults to 1024).
|
B |
setCompressionType(GelfLayout.CompressionType compressionType) |
Compression to use (optional, defaults to GZIP).
|
B |
setHost(String host) |
The value of the
host property (optional, defaults to local host name). |
B |
setIncludeNullDelimiter(boolean includeNullDelimiter) |
Whether to include NULL byte as delimiter after each event (optional, default to false).
|
B |
setIncludeStacktrace(boolean includeStacktrace) |
Whether to include full stacktrace of logged Throwables (optional, default to true).
|
B |
setIncludeThreadContext(boolean includeThreadContext) |
Whether to include thread context as additional fields (optional, default to true).
|
asBuilder, getConfiguration, getFooter, getHeader, setConfiguration, setFooter, setHeader
getCharset, getFooterSerializer, getHeaderSerializer, setCharset, setFooterSerializer, setHeaderSerializer
public GelfLayout build()
Builder
build
in interface Builder<B extends GelfLayout.Builder<B>>
public String getHost()
public GelfLayout.CompressionType getCompressionType()
public int getCompressionThreshold()
public boolean isIncludeStacktrace()
public boolean isIncludeThreadContext()
public boolean isIncludeNullDelimiter()
public KeyValuePair[] getAdditionalFields()
public B setHost(String host)
host
property (optional, defaults to local host name).public B setCompressionType(GelfLayout.CompressionType compressionType)
public B setCompressionThreshold(int compressionThreshold)
public B setIncludeStacktrace(boolean includeStacktrace)
public B setIncludeThreadContext(boolean includeThreadContext)
public B setIncludeNullDelimiter(boolean includeNullDelimiter)
public B setAdditionalFields(KeyValuePair[] additionalFields)
Copyright © 1999-2018. 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.