Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-beta4
-
None
-
None
Description
One of the main considerations for selecting a logging library is performance, specifically, how long it takes for a call to Logger.log to return. (See the comments of LOG4J-151 for a discussion of latency versus application throughput and logging throughput.)
I believe it is possible to improve this performance by an order of magnitude by having an asynchronous Logger implementation that hands off the work to a separate thread as early as possible. The disk I/O would be done in this separate thread.
AsynchAppender is not a good match for these requirements, as with that approach (a) the logging call still needs to flow down the hierarchy to the appender, doing synchronization and creating objects at various points on the way, and (b) when serializing the LogEvent, the getSource() method is always called, which is expensive.
Attachments
Attachments
Issue Links
- depends upon
-
LOG4J2-151 Please facilitate subclassing Logger and LoggerContext (in org.apache.logging.log4j.core)
- Closed
-
LOG4J2-157 Provide access to config properties in LoggerConfig
- Closed
-
LOG4J2-154 ThreadContext performance improvement: shallow copies for reads, deep copies for writes
- Resolved
-
LOG4J2-153 Async Logger/Appender performance improvement: provide mechanism to discover if location StackTraceElement is actually required downstream.
- Closed