You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2023/01/16 21:34:52 UTC

[GitHub] [logging-log4j2] jvz commented on a diff in pull request #1194: Migrate Recycler API to log4j-api

jvz commented on code in PR #1194:
URL: https://github.com/apache/logging-log4j2/pull/1194#discussion_r1071590262


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/GelfLayout.java:
##########
@@ -598,12 +636,22 @@ private StringBuilder toText(final LogEvent event, final StringBuilder builder,
         if (event.getThrown() != null || layout != null) {
             builder.append("\"full_message\":\"");
             if (layout != null) {
-                final StringBuilder messageBuffer = getMessageStringBuilder();
-                layout.serialize(event, messageBuffer);
-                JsonUtils.quoteAsString(messageBuffer, builder);
+                final StringBuilder messageBuffer = acquireStringBuilder();

Review Comment:
   Interesting little use case where you can now abuse the recursion support in `ThreadLocalRecyclerFactory` to get multiple recyclable objects. Already works as expected with the `QueueingRecyclerFactory` version.



-- 
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-unsubscribe@logging.apache.org

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