Enum EventRoute
- java.lang.Object
-
- java.lang.Enum<EventRoute>
-
- org.apache.logging.log4j.core.async.EventRoute
-
- All Implemented Interfaces:
Serializable
,Comparable<EventRoute>
public enum EventRoute extends Enum<EventRoute>
Enumeration over the different destinations where a log event can be sent.- Since:
- 2.6
- See Also:
AsyncQueueFullPolicy
,AsyncQueueFullPolicyFactory
,DefaultAsyncQueueFullPolicy
,DiscardingAsyncQueueFullPolicy
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DISCARD
Discards the event (so it is not logged at all).ENQUEUE
Enqueues the event for asynchronous logging in the background thread.SYNCHRONOUS
Logs the event synchronously: sends the event directly to the appender (in the current thread).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
logMessage(AsyncAppender asyncAppender, LogEvent coreEvent)
abstract void
logMessage(AsyncLoggerConfig asyncLoggerConfig, LogEvent event)
abstract void
logMessage(AsyncLogger asyncLogger, String fqcn, Level level, Marker marker, Message message, Throwable thrown)
static EventRoute
valueOf(String name)
Returns the enum constant of this type with the specified name.static EventRoute[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ENQUEUE
public static final EventRoute ENQUEUE
Enqueues the event for asynchronous logging in the background thread.
-
SYNCHRONOUS
public static final EventRoute SYNCHRONOUS
Logs the event synchronously: sends the event directly to the appender (in the current thread). WARNING: This may result in lines logged out of order as synchronous events may be persisted before earlier events, even from the same thread, which wait in the queue.
-
DISCARD
public static final EventRoute DISCARD
Discards the event (so it is not logged at all).
-
-
Method Detail
-
values
public static EventRoute[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EventRoute c : EventRoute.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EventRoute valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
logMessage
public abstract void logMessage(AsyncLogger asyncLogger, String fqcn, Level level, Marker marker, Message message, Throwable thrown)
-
logMessage
public abstract void logMessage(AsyncLoggerConfig asyncLoggerConfig, LogEvent event)
-
logMessage
public abstract void logMessage(AsyncAppender asyncAppender, LogEvent coreEvent)
-
-