Class ReusableLogEventFactory
- java.lang.Object
-
- org.apache.logging.log4j.core.impl.ReusableLogEventFactory
-
- All Implemented Interfaces:
org.apache.logging.log4j.core.impl.LocationAwareLogEventFactory,org.apache.logging.log4j.core.impl.LogEventFactory
public class ReusableLogEventFactory extends Object implements org.apache.logging.log4j.core.impl.LogEventFactory, org.apache.logging.log4j.core.impl.LocationAwareLogEventFactory
Garbage-free LogEventFactory that reuses a single mutable log event.- Since:
- 2.6
-
-
Constructor Summary
Constructors Constructor Description ReusableLogEventFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.logging.log4j.core.LogEventcreateEvent(String loggerName, org.apache.logging.log4j.Marker marker, String fqcn, StackTraceElement location, org.apache.logging.log4j.Level level, org.apache.logging.log4j.message.Message message, List<org.apache.logging.log4j.core.config.Property> properties, Throwable t)Creates a log event.org.apache.logging.log4j.core.LogEventcreateEvent(String loggerName, org.apache.logging.log4j.Marker marker, String fqcn, org.apache.logging.log4j.Level level, org.apache.logging.log4j.message.Message message, List<org.apache.logging.log4j.core.config.Property> properties, Throwable t)Creates a log event.static voidrelease(org.apache.logging.log4j.core.LogEvent logEvent)Switches thereservedflag off if the specified event is a MutableLogEvent, otherwise does nothing.
-
-
-
Method Detail
-
createEvent
public org.apache.logging.log4j.core.LogEvent createEvent(String loggerName, org.apache.logging.log4j.Marker marker, String fqcn, org.apache.logging.log4j.Level level, org.apache.logging.log4j.message.Message message, List<org.apache.logging.log4j.core.config.Property> properties, Throwable t)
Creates a log event.- Specified by:
createEventin interfaceorg.apache.logging.log4j.core.impl.LogEventFactory- Parameters:
loggerName- The name of the Logger.marker- An optional Marker.fqcn- The fully qualified class name of the caller.level- The event Level.message- The Message.properties- Properties to be added to the log event.t- An optional Throwable.- Returns:
- The LogEvent.
-
createEvent
public org.apache.logging.log4j.core.LogEvent createEvent(String loggerName, org.apache.logging.log4j.Marker marker, String fqcn, StackTraceElement location, org.apache.logging.log4j.Level level, org.apache.logging.log4j.message.Message message, List<org.apache.logging.log4j.core.config.Property> properties, Throwable t)
Creates a log event.- Specified by:
createEventin interfaceorg.apache.logging.log4j.core.impl.LocationAwareLogEventFactory- Specified by:
createEventin interfaceorg.apache.logging.log4j.core.impl.LogEventFactory- Parameters:
loggerName- The name of the Logger.marker- An optional Marker.fqcn- The fully qualified class name of the caller.location- The location of the caller.level- The event Level.message- The Message.properties- Properties to be added to the log event.t- An optional Throwable.- Returns:
- The LogEvent.
-
release
public static void release(org.apache.logging.log4j.core.LogEvent logEvent)
Switches thereservedflag off if the specified event is a MutableLogEvent, otherwise does nothing. This flag is used internally to verify that a reusable log event is no longer in use and can be reused.- Parameters:
logEvent- the log event to make available again- Since:
- 2.7
-
-