@Plugin(name="SyslogLayout", category="Core", elementType="layout", printObject=true) public final class SyslogLayout extends AbstractStringLayout
| Modifier and Type | Class and Description |
|---|---|
static class |
SyslogLayout.Builder<B extends SyslogLayout.Builder<B>>
Builds a SyslogLayout.
|
AbstractStringLayout.Serializer, AbstractStringLayout.Serializer2| Modifier and Type | Field and Description |
|---|---|
private java.text.SimpleDateFormat |
dateFormat
Date format used if header = true.
|
private java.lang.String |
escapeNewLine |
private Facility |
facility |
private boolean |
includeNewLine |
private java.lang.String |
localHostname
Host name used to identify messages from this appender.
|
static java.util.regex.Pattern |
NEWLINE_PATTERN
Match newlines in a platform-independent manner.
|
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZEconfiguration, eventCount, footer, header, LOGGERELEMENT_TYPE| Modifier | Constructor and Description |
|---|---|
protected |
SyslogLayout(Facility facility,
boolean includeNL,
java.lang.String escapeNL,
java.nio.charset.Charset charset) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addDate(long timestamp,
java.lang.StringBuilder buf) |
static SyslogLayout |
createLayout(Facility facility,
boolean includeNewLine,
java.lang.String escapeNL,
java.nio.charset.Charset charset)
Deprecated.
Use
newBuilder(). |
java.util.Map<java.lang.String,java.lang.String> |
getContentFormat()
Gets this SyslogLayout's content format.
|
Facility |
getFacility()
Gets the facility.
|
static <B extends SyslogLayout.Builder<B>> |
newBuilder() |
java.lang.String |
toSerializable(LogEvent event)
Formats a
LogEvent in conformance with the BSD Log record format. |
getBytes, getCharset, getContentType, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, serializeToBytes, serializeToString, toByteArray, trimToMaxSizeencode, getConfiguration, markEvent, writeTopublic static final java.util.regex.Pattern NEWLINE_PATTERN
private final Facility facility
private final boolean includeNewLine
private final java.lang.String escapeNewLine
private final java.text.SimpleDateFormat dateFormat
private final java.lang.String localHostname
protected SyslogLayout(Facility facility, boolean includeNL, java.lang.String escapeNL, java.nio.charset.Charset charset)
@PluginBuilderFactory public static <B extends SyslogLayout.Builder<B>> B newBuilder()
public java.lang.String toSerializable(LogEvent event)
LogEvent in conformance with the BSD Log record format.event - The LogEventprivate void addDate(long timestamp,
java.lang.StringBuilder buf)
public java.util.Map<java.lang.String,java.lang.String> getContentFormat()
getContentFormat in interface Layout<java.lang.String>getContentFormat in class AbstractLayout<java.lang.String>@Deprecated public static SyslogLayout createLayout(Facility facility, boolean includeNewLine, java.lang.String escapeNL, java.nio.charset.Charset charset)
newBuilder().facility - The Facility is used to try to classify the message.includeNewLine - If true a newline will be appended to the result.escapeNL - Pattern to use for replacing newlines.charset - The character set.public Facility getFacility()