You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/01/23 07:14:11 UTC

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

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


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java:
##########
@@ -270,9 +265,10 @@ protected String serializeToString(final Serializer serializer) {
         if (serializer == null) {
             return null;
         }
-        final LoggerConfig rootLogger = getConfiguration().getRootLogger();
+        final LoggerConfig rootLogger = configuration.getRootLogger();
+        final LogEventFactory logEventFactory = configuration.getLogEventFactory();
         // Using "" for the FQCN, does it matter?
-        final LogEvent logEvent = getLogEventFactory().createEvent(rootLogger.getName(), null, Strings.EMPTY,
+        final LogEvent logEvent = logEventFactory.createEvent(rootLogger.getName(), null, Strings.EMPTY,

Review Comment:
   I don't see the need for extracting a local variable.



-- 
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