@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,
AmqpAppender.AmqpManager manager,
BlockingQueue<AmqpAppender.Event> eventQueue) |
Modifier and Type | Method and Description |
---|---|
void |
append(org.apache.logging.log4j.core.LogEvent event) |
static AmqpAppender |
createAppender(org.apache.logging.log4j.core.config.Configuration configuration,
String name,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
org.apache.logging.log4j.core.Filter filter,
boolean ignoreExceptions,
URI uri,
String host,
String port,
String addresses,
String user,
String password,
String virtualHost,
boolean useSsl,
boolean verifyHostname,
String sslAlgorithm,
String sslPropertiesLocation,
String keyStore,
String keyStorePassphrase,
String keyStoreType,
String trustStore,
String trustStorePassphrase,
String trustStoreType,
String saslConfig,
int senderPoolSize,
int maxSenderRetries,
String applicationId,
String routingKeyPattern,
boolean generateId,
String deliveryMode,
String exchange,
String exchangeType,
boolean declareExchange,
boolean durable,
boolean autoDelete,
String contentType,
String contentEncoding,
String connectionName,
String clientConnectionProperties,
boolean async,
String charset,
int bufferSize,
org.apache.logging.log4j.core.async.BlockingQueueFactory<AmqpAppender.Event> blockingQueueFactory,
boolean addMdcAsHeaders)
Deprecated.
|
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() |
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, AmqpAppender.AmqpManager manager, BlockingQueue<AmqpAppender.Event> eventQueue)
@Deprecated @PluginFactory public static AmqpAppender createAppender(@PluginConfiguration org.apache.logging.log4j.core.config.Configuration configuration, @PluginAttribute(value="name") String name, @PluginElement(value="Layout") org.apache.logging.log4j.core.Layout<? extends Serializable> layout, @PluginElement(value="Filter") org.apache.logging.log4j.core.Filter filter, @PluginAttribute(value="ignoreExceptions") boolean ignoreExceptions, @PluginAttribute(value="uri") URI uri, @PluginAttribute(value="host") String host, @PluginAttribute(value="port") String port, @PluginAttribute(value="addresses") String addresses, @PluginAttribute(value="user") String user, @PluginAttribute(value="password") String password, @PluginAttribute(value="virtualHost") String virtualHost, @PluginAttribute(value="useSsl") boolean useSsl, @PluginAttribute(value="verifyHostname") boolean verifyHostname, @PluginAttribute(value="sslAlgorithm") String sslAlgorithm, @PluginAttribute(value="sslPropertiesLocation") String sslPropertiesLocation, @PluginAttribute(value="keyStore") String keyStore, @PluginAttribute(value="keyStorePassphrase") String keyStorePassphrase, @PluginAttribute(value="keyStoreType") String keyStoreType, @PluginAttribute(value="trustStore") String trustStore, @PluginAttribute(value="trustStorePassphrase") String trustStorePassphrase, @PluginAttribute(value="trustStoreType") String trustStoreType, @PluginAttribute(value="saslConfig") String saslConfig, @PluginAttribute(value="senderPoolSize") int senderPoolSize, @PluginAttribute(value="maxSenderRetries") int maxSenderRetries, @PluginAttribute(value="applicationId") String applicationId, @PluginAttribute(value="routingKeyPattern") String routingKeyPattern, @PluginAttribute(value="generateId") boolean generateId, @PluginAttribute(value="deliveryMode") String deliveryMode, @PluginAttribute(value="exchange") String exchange, @PluginAttribute(value="exchangeType") String exchangeType, @PluginAttribute(value="declareExchange") boolean declareExchange, @PluginAttribute(value="durable") boolean durable, @PluginAttribute(value="autoDelete") boolean autoDelete, @PluginAttribute(value="contentType") String contentType, @PluginAttribute(value="contentEncoding") String contentEncoding, @PluginAttribute(value="connectionName") String connectionName, @PluginAttribute(value="clientConnectionProperties") String clientConnectionProperties, @PluginAttribute(value="async") boolean async, @PluginAttribute(value="charset") String charset, @PluginAttribute(value="bufferSize",defaultInt=2147483647) int bufferSize, @PluginElement(value="BlockingQueueFactory") org.apache.logging.log4j.core.async.BlockingQueueFactory<AmqpAppender.Event> blockingQueueFactory, @PluginAttribute(value="addMdcAsHeaders",defaultBoolean=true) boolean addMdcAsHeaders)
@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()