Class JeroMqAppender
- 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.mom.jeromq.JeroMqAppender
-
- All Implemented Interfaces:
Appender
,Filterable
,LocationAware
,LifeCycle
,LifeCycle2
@Plugin(name="JeroMQ", category="Core", elementType="appender", printObject=true) public final class JeroMqAppender extends AbstractAppender
Sends log events to one or more ZeroMQ (JeroMQ) endpoints.Requires the JeroMQ jar (LGPL as of 0.3.5)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
AbstractAppender.Builder<B extends AbstractAppender.Builder<B>>
-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
-
Field Summary
Fields Modifier and Type Field Description private static int
DEFAULT_BACKLOG
private static int
DEFAULT_IVL
private static int
DEFAULT_RCV_HWM
private static int
DEFAULT_SND_HWM
private java.util.List<java.lang.String>
endpoints
private JeroMqManager
manager
private int
sendRcFalse
private int
sendRcTrue
-
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
Constructors Modifier Constructor Description private
JeroMqAppender(java.lang.String name, Filter filter, Layout<? extends java.io.Serializable> layout, boolean ignoreExceptions, java.util.List<java.lang.String> endpoints, long affinity, long backlog, boolean delayAttachOnConnect, byte[] identity, boolean ipv4Only, long linger, long maxMsgSize, long rcvHwm, long receiveBufferSize, int receiveTimeOut, long reconnectIVL, long reconnectIVLMax, long sendBufferSize, int sendTimeOut, long sndHWM, int tcpKeepAlive, long tcpKeepAliveCount, long tcpKeepAliveIdle, long tcpKeepAliveInterval, boolean xpubVerbose, Property[] properties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(LogEvent event)
Logs a LogEvent using whatever logic this Appender wishes to use.static JeroMqAppender
createAppender(java.lang.String name, Layout<?> layout, Filter filter, Property[] properties, boolean ignoreExceptions, long affinity, long backlog, boolean delayAttachOnConnect, byte[] identity, boolean ipv4Only, long linger, long maxMsgSize, long rcvHwm, long receiveBufferSize, int receiveTimeOut, long reconnectIVL, long reconnectIVLMax, long sendBufferSize, int sendTimeOut, long sndHwm, int tcpKeepAlive, long tcpKeepAliveCount, long tcpKeepAliveIdle, long tcpKeepAliveInterval, boolean xpubVerbose)
(package private) int
getSendRcFalse()
(package private) int
getSendRcTrue()
(package private) void
resetSendRcs()
boolean
stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
Cleanup the Filter.java.lang.String
toString()
-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable
-
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, start, stop
-
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 Detail
-
DEFAULT_BACKLOG
private static final int DEFAULT_BACKLOG
- See Also:
- Constant Field Values
-
DEFAULT_IVL
private static final int DEFAULT_IVL
- See Also:
- Constant Field Values
-
DEFAULT_RCV_HWM
private static final int DEFAULT_RCV_HWM
- See Also:
- Constant Field Values
-
DEFAULT_SND_HWM
private static final int DEFAULT_SND_HWM
- See Also:
- Constant Field Values
-
manager
private final JeroMqManager manager
-
endpoints
private final java.util.List<java.lang.String> endpoints
-
sendRcFalse
private int sendRcFalse
-
sendRcTrue
private int sendRcTrue
-
-
Constructor Detail
-
JeroMqAppender
private JeroMqAppender(java.lang.String name, Filter filter, Layout<? extends java.io.Serializable> layout, boolean ignoreExceptions, java.util.List<java.lang.String> endpoints, long affinity, long backlog, boolean delayAttachOnConnect, byte[] identity, boolean ipv4Only, long linger, long maxMsgSize, long rcvHwm, long receiveBufferSize, int receiveTimeOut, long reconnectIVL, long reconnectIVLMax, long sendBufferSize, int sendTimeOut, long sndHWM, int tcpKeepAlive, long tcpKeepAliveCount, long tcpKeepAliveIdle, long tcpKeepAliveInterval, boolean xpubVerbose, Property[] properties)
-
-
Method Detail
-
createAppender
@PluginFactory public static JeroMqAppender createAppender(@Required(message="No name provided for JeroMqAppender") @PluginAttribute("name") java.lang.String name, @PluginElement("Layout") Layout<?> layout, @PluginElement("Filter") Filter filter, @PluginElement("Properties") Property[] properties, @PluginAttribute("ignoreExceptions") boolean ignoreExceptions, @PluginAttribute(value="affinity",defaultLong=0L) long affinity, @PluginAttribute(value="backlog",defaultLong=100L) long backlog, @PluginAttribute("delayAttachOnConnect") boolean delayAttachOnConnect, @PluginAttribute("identity") byte[] identity, @PluginAttribute(value="ipv4Only",defaultBoolean=true) boolean ipv4Only, @PluginAttribute(value="linger",defaultLong=-1L) long linger, @PluginAttribute(value="maxMsgSize",defaultLong=-1L) long maxMsgSize, @PluginAttribute(value="rcvHwm",defaultLong=1000L) long rcvHwm, @PluginAttribute(value="receiveBufferSize",defaultLong=0L) long receiveBufferSize, @PluginAttribute(value="receiveTimeOut",defaultLong=-1L) int receiveTimeOut, @PluginAttribute(value="reconnectIVL",defaultLong=100L) long reconnectIVL, @PluginAttribute(value="reconnectIVLMax",defaultLong=0L) long reconnectIVLMax, @PluginAttribute(value="sendBufferSize",defaultLong=0L) long sendBufferSize, @PluginAttribute(value="sendTimeOut",defaultLong=-1L) int sendTimeOut, @PluginAttribute(value="sndHwm",defaultLong=1000L) long sndHwm, @PluginAttribute(value="tcpKeepAlive",defaultInt=-1) int tcpKeepAlive, @PluginAttribute(value="tcpKeepAliveCount",defaultLong=-1L) long tcpKeepAliveCount, @PluginAttribute(value="tcpKeepAliveIdle",defaultLong=-1L) long tcpKeepAliveIdle, @PluginAttribute(value="tcpKeepAliveInterval",defaultLong=-1L) long tcpKeepAliveInterval, @PluginAttribute("xpubVerbose") boolean xpubVerbose)
-
append
public void append(LogEvent event)
Description copied from interface:Appender
Logs a LogEvent using whatever logic this Appender wishes to use. It is typically recommended to use a bridge pattern not only for the benefits from decoupling an Appender from its implementation, but it is also handy for sharing resources which may require some form of locking.- Parameters:
event
- The LogEvent.
-
stop
public boolean stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
Description copied from class:AbstractFilterable
Cleanup the Filter.- Specified by:
stop
in interfaceLifeCycle2
- Overrides:
stop
in classAbstractFilterable
- Parameters:
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argument- Returns:
- true if the receiver was stopped cleanly and normally, false otherwise.
-
getSendRcFalse
int getSendRcFalse()
-
getSendRcTrue
int getSendRcTrue()
-
resetSendRcs
void resetSendRcs()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractAppender
-
-