@Plugin(name="RabbitMQ",
category="Core",
elementType="appender",
printObject=true)
public class AmqpAppender
extends org.apache.logging.log4j.core.appender.AbstractAppender
Modifier and Type | Class and Description |
---|---|
protected static class |
AmqpAppender.AmqpManager
Manager class for the appender.
|
protected static class |
AmqpAppender.Builder |
protected static class |
AmqpAppender.Event
Helper class to encapsulate a LoggingEvent, its MDC properties, and the number of retries.
|
protected class |
AmqpAppender.EventSender
Helper class to actually send LoggingEvents asynchronously.
|
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_ID
Key name for the application id (if there is one set via the appender config) in the message properties.
|
static String |
CATEGORY_LEVEL
Key name for the logger level name in the message properties.
|
static String |
CATEGORY_NAME
Key name for the logger category name in the message properties.
|
static String |
THREAD_NAME
Key name for the thread name in the message properties.
|
Constructor and Description |
---|
AmqpAppender(String name,
org.apache.logging.log4j.core.Filter filter,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
boolean ignoreExceptions,
org.apache.logging.log4j.core.config.Property[] properties,
AmqpAppender.AmqpManager manager,
BlockingQueue<AmqpAppender.Event> eventQueue)
Construct an instance with the provided properties.
|
Modifier and Type | Method and Description |
---|---|
void |
append(org.apache.logging.log4j.core.LogEvent event) |
protected void |
doSend(AmqpAppender.Event event,
org.apache.logging.log4j.core.LogEvent logEvent,
MessageProperties amqpProps) |
int |
getQueuedEventCount()
Return the number of events waiting to be sent.
|
static AmqpAppender.Builder |
newBuilder()
Create a new builder.
|
protected Message |
postProcessMessageBeforeSend(Message message,
AmqpAppender.Event event)
Subclasses may modify the final message before sending.
|
protected void |
sendEvent(AmqpAppender.Event event,
Map<?,?> properties) |
protected boolean |
stop(long timeout,
TimeUnit timeUnit,
boolean changeLifeCycleState) |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toString
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, start, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
public static final String APPLICATION_ID
public static final String CATEGORY_NAME
public static final String CATEGORY_LEVEL
public static final String THREAD_NAME
public AmqpAppender(String name, org.apache.logging.log4j.core.Filter filter, org.apache.logging.log4j.core.Layout<? extends Serializable> layout, boolean ignoreExceptions, org.apache.logging.log4j.core.config.Property[] properties, AmqpAppender.AmqpManager manager, BlockingQueue<AmqpAppender.Event> eventQueue)
name
- the name.filter
- the filter.layout
- the layout.ignoreExceptions
- true to ignore exceptions.manager
- the manager.eventQueue
- the event queue.properties
- the properties.@PluginBuilderFactory public static AmqpAppender.Builder newBuilder()
public void append(org.apache.logging.log4j.core.LogEvent event)
protected Message postProcessMessageBeforeSend(Message message, AmqpAppender.Event event)
message
- The message.event
- The event.protected void sendEvent(AmqpAppender.Event event, Map<?,?> properties)
protected void doSend(AmqpAppender.Event event, org.apache.logging.log4j.core.LogEvent logEvent, MessageProperties amqpProps)
protected boolean stop(long timeout, TimeUnit timeUnit, boolean changeLifeCycleState)
stop
in class org.apache.logging.log4j.core.filter.AbstractFilterable
public int getQueuedEventCount()