Description
See LOG4J2-2975. DefaultLogEventBuilder does
private void innerLog(LoggingEvent logggingEvent) { if (logger instanceof LoggingEventAware) { ((LoggingEventAware) logger).log(logggingEvent); } else { logViaPublicLoggerAPI(logggingEvent); } }
In both alternatives DefaultLogEventBuilder is going to show up as the caller of the logging API since there is no provision made to allow the implementation to determine the caller of the log method in DefaultEventBuilder.
As such, for all practical purposes this class is useless. This issue does not affect Logback since it is using the NOPLoggingEventBuilder so the fluent API doesn't work in Logback at all. If it were using DefaultLogEventBuilder it would suffer from the same problem.
The workaround is that any implementation that wants to support SLF4J's fluent API must implement its own LogEventBuilder.