Class SyslogAppender
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender<AbstractSocketManager>
org.apache.logging.log4j.core.appender.SocketAppender
org.apache.logging.log4j.core.appender.SyslogAppender
- All Implemented Interfaces:
Appender
,Filterable
,LocationAware
,LifeCycle
,LifeCycle2
@Plugin(name="Syslog",
category="Core",
elementType="appender",
printObject=true)
public class SyslogAppender
extends SocketAppender
The Syslog Appender.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
SyslogAppender.Builder<B extends SyslogAppender.Builder<B>>
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.SocketAppender
SocketAppender.AbstractBuilder<B extends SocketAppender.AbstractBuilder<B>>
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Fields inherited from interface org.apache.logging.log4j.core.Appender
ELEMENT_TYPE, EMPTY_ARRAY
-
Constructor Summary
ModifierConstructorDescriptionprotected
SyslogAppender
(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, AbstractSocketManager manager, Advertiser advertiser) Deprecated.protected
SyslogAppender
(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, AbstractSocketManager manager, Advertiser advertiser, Property[] properties) -
Method Summary
Modifier and TypeMethodDescriptionstatic <B extends SyslogAppender.Builder<B>>
SyslogAppendercreateAppender
(String host, int port, String protocolStr, SslConfiguration sslConfiguration, int connectTimeoutMillis, int reconnectDelayMillis, boolean immediateFail, String name, boolean immediateFlush, boolean ignoreExceptions, Facility facility, String id, int enterpriseNumber, boolean includeMdc, String mdcId, String mdcPrefix, String eventPrefix, boolean newLine, String escapeNL, String appName, String msgId, String excludes, String includes, String required, String format, Filter filter, Configuration configuration, Charset charset, String exceptionPattern, LoggerFields[] loggerFields, boolean advertise) Deprecated.static <B extends SyslogAppender.Builder<B>>
BMethods inherited from class org.apache.logging.log4j.core.appender.SocketAppender
createAppender, createAppender, createSocketManager, createSocketManager, directEncodeEvent, newBuilder, stop
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
append, getImmediateFlush, getManager, start, stop, writeByteArrayToManager
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toString
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
Field Details
-
RFC5424
- See Also:
-
-
Constructor Details
-
SyslogAppender
protected SyslogAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, AbstractSocketManager manager, Advertiser advertiser, Property[] properties) -
SyslogAppender
@Deprecated protected SyslogAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, AbstractSocketManager manager, Advertiser advertiser)
-
-
Method Details
-
createAppender
@Deprecated public static <B extends SyslogAppender.Builder<B>> SyslogAppender createAppender(String host, int port, String protocolStr, SslConfiguration sslConfiguration, int connectTimeoutMillis, int reconnectDelayMillis, boolean immediateFail, String name, boolean immediateFlush, boolean ignoreExceptions, Facility facility, String id, int enterpriseNumber, boolean includeMdc, String mdcId, String mdcPrefix, String eventPrefix, boolean newLine, String escapeNL, String appName, String msgId, String excludes, String includes, String required, String format, Filter filter, Configuration configuration, Charset charset, String exceptionPattern, LoggerFields[] loggerFields, boolean advertise) Deprecated.Creates a SyslogAppender.- Parameters:
host
- The name of the host to connect to.port
- The port to connect to on the target host.protocolStr
- The Protocol to use.sslConfiguration
- TODOconnectTimeoutMillis
- the connect timeout in milliseconds.reconnectDelayMillis
- The interval in which failed writes should be retried.immediateFail
- True if the write should fail if no socket is immediately available.name
- The name of the Appender.immediateFlush
- "true" if data should be flushed on each write.ignoreExceptions
- If"true"
(default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller.facility
- The Facility is used to try to classify the message.id
- The default structured data id to use when formatting according to RFC 5424.enterpriseNumber
- The IANA enterprise number.includeMdc
- Indicates whether data from the ThreadContextMap will be included in the RFC 5424 Syslog record. Defaults to "true:.mdcId
- The id to use for the MDC Structured Data Element.mdcPrefix
- The prefix to add to MDC key names.eventPrefix
- The prefix to add to event key names.newLine
- If true, a newline will be appended to the end of the syslog record. The default is false.escapeNL
- String that should be used to replace newlines within the message text.appName
- The value to use as the APP-NAME in the RFC 5424 syslog record.msgId
- The default value to be used in the MSGID field of RFC 5424 syslog records.excludes
- A comma separated list of mdc keys that should be excluded from the LogEvent.includes
- A comma separated list of mdc keys that should be included in the FlumeEvent.required
- A comma separated list of mdc keys that must be present in the MDC.format
- If set to "RFC5424" the data will be formatted in accordance with RFC 5424. Otherwise, it will be formatted as a BSD Syslog record.filter
- A Filter to determine if the event should be handled by this Appender.configuration
- The Configuration.charset
- The character set to use when converting the syslog String to a byte array.exceptionPattern
- The converter pattern to use for formatting exceptions.loggerFields
- The logger fieldsadvertise
- Whether to advertise- Returns:
- A SyslogAppender.
-
newSyslogAppenderBuilder
@PluginBuilderFactory public static <B extends SyslogAppender.Builder<B>> B newSyslogAppenderBuilder()
-
SyslogAppender(String, Layout, Filter, boolean, boolean, AbstractSocketManager, Advertiser, Property[])
.