ppkarwasz commented on code in PR #1401:
URL: https://github.com/apache/logging-log4j2/pull/1401#discussion_r1174447095


##########
log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java:
##########
@@ -2762,12 +2746,8 @@ public LogBuilder atLevel(final Level level) {
      * @since 2.20.0
      */
     protected LogBuilder getLogBuilder(Level level) {
-        if (Constants.ENABLE_THREADLOCALS) {
-            DefaultLogBuilder builder = logBuilder.get();
-            if (!builder.isInUse()) {
-                return builder.reset(this, level);
-            }
-        }
-        return new DefaultLogBuilder(this, level);
+        DefaultLogBuilder builder = recycler.acquire();

Review Comment:
   I thought about introducing a `RecyclerAware` interface with a `setRecycler` 
method. Classes like the `DefaultLogBuilder` or `ReusableParameterizedMessage` 
would implement it.
   
   Of course your solution also works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to