@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 |
---|---|
static Pattern |
NEWLINE_PATTERN
Match newlines in a platform-independent manner.
|
DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE
configuration, eventCount, footer, header, LOGGER
ELEMENT_TYPE
Modifier | Constructor and Description |
---|---|
protected |
SyslogLayout(Facility facility,
boolean includeNL,
String escapeNL,
Charset charset) |
Modifier and Type | Method and Description |
---|---|
static SyslogLayout |
createLayout(Facility facility,
boolean includeNewLine,
String escapeNL,
Charset charset)
Deprecated.
Use
newBuilder() . |
Map<String,String> |
getContentFormat()
Gets this SyslogLayout's content format.
|
Facility |
getFacility()
Gets the facility.
|
static <B extends SyslogLayout.Builder<B>> |
newBuilder() |
String |
toSerializable(LogEvent event)
Formats a
LogEvent in conformance with the BSD Log record format. |
getBytes, getCharset, getContentType, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
encode, getConfiguration, markEvent
public static final Pattern NEWLINE_PATTERN
protected SyslogLayout(Facility facility, boolean includeNL, String escapeNL, Charset charset)
@PluginBuilderFactory public static <B extends SyslogLayout.Builder<B>> B newBuilder()
public String toSerializable(LogEvent event)
LogEvent
in conformance with the BSD Log record format.event
- The LogEventpublic Map<String,String> getContentFormat()
getContentFormat
in interface Layout<String>
getContentFormat
in class AbstractLayout<String>
@Deprecated public static SyslogLayout createLayout(Facility facility, boolean includeNewLine, String escapeNL, 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()
Copyright © 1999-2021 The Apache Software Foundation. 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.