Description
I would like to create a custom logger, while reusing the org.apache.logging.log4j.core.Logger functionality.
The following two changes would make subclassing possible:
- change visibility of method Logger$PrivateConfig#logEvent(LogEvent) (line 265) from protected to public
- change visibility of method LoggerContext#newInstance(LoggerContext, String) (line 310) from private to protected
My use case is that I want to create an asynchronous Logger for low latency logging.
This custom logger hands off control to a separate thread as early as possible. In my case, AsynchAppender is not a good match for my 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-157 Provide access to config properties in LoggerConfig
- Closed
- is depended upon by
-
LOG4J2-163 Create asynchronous Logger for low-latency logging
- Closed
- relates to
-
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