@Plugin(name="SyslogLayout", category="Core", elementType="layout", printObject=true) public final class SyslogLayout extends AbstractStringLayout
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
NEWLINE_PATTERN
Match newlines in a platform-independent manner.
|
footer, header, LOGGERELEMENT_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)
Create a SyslogLayout.
|
Map<String,String> |
getContentFormat()
Gets this SyslogLayout's content format.
|
String |
toSerializable(LogEvent event)
Formats a
LogEvent in conformance with the BSD Log record format. |
getBytes, getCharset, getContentType, toByteArraygetFooter, getHeaderpublic static final Pattern NEWLINE_PATTERN
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>@PluginFactory public static SyslogLayout createLayout(@PluginAttribute(value="facility",defaultString="LOCAL0") Facility facility, @PluginAttribute(value="newLine",defaultBoolean=false) boolean includeNewLine, @PluginAttribute(value="newLineEscape") String escapeNL, @PluginAttribute(value="charset",defaultString="UTF-8") Charset charset)
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.Copyright © 1999-2021 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.