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 2021/12/19 00:20:19 UTC

[GitHub] [logging-log4j2] carterkozak opened a new pull request #641: Fix string substitution recursion

carterkozak opened a new pull request #641:
URL: https://github.com/apache/logging-log4j2/pull/641


   cherry-pick of 806023265f8c905b2dd1d81fd2458f64b2ea0b5e


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



[GitHub] [logging-log4j2] rgoers merged pull request #641: [2.12 backport] Fix string substitution recursion

Posted by GitBox <gi...@apache.org>.
rgoers merged pull request #641:
URL: https://github.com/apache/logging-log4j2/pull/641


   


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



[GitHub] [logging-log4j2] carterkozak commented on a change in pull request #641: Fix string substitution recursion

Posted by GitBox <gi...@apache.org>.
carterkozak commented on a change in pull request #641:
URL: https://github.com/apache/logging-log4j2/pull/641#discussion_r771879643



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
##########
@@ -180,7 +181,9 @@ private void injectFields(final Builder<?> builder) throws IllegalAccessExceptio
                     final Object value = visitor.setAliases(aliases)
                         .setAnnotation(a)
                         .setConversionType(field.getType())
-                        .setStrSubstitutor(configuration.getStrSubstitutor())
+                        .setStrSubstitutor(event == null
+                                ? new ConfigurationStrSubstitutor(configuration.getStrSubstitutor())
+                                : configuration.getStrSubstitutor())

Review comment:
       manual edit

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginBuilder.java
##########
@@ -253,7 +256,9 @@ private static Method findFactoryMethod(final Class<?> clazz) {
                     final Object value = visitor.setAliases(aliases)
                         .setAnnotation(a)
                         .setConversionType(types[i])
-                        .setStrSubstitutor(configuration.getStrSubstitutor())
+                        .setStrSubstitutor(event == null
+                                ? new ConfigurationStrSubstitutor(configuration.getStrSubstitutor())
+                                : configuration.getStrSubstitutor())

Review comment:
       here as well




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



[GitHub] [logging-log4j2] carterkozak commented on a change in pull request #641: Fix string substitution recursion

Posted by GitBox <gi...@apache.org>.
carterkozak commented on a change in pull request #641:
URL: https://github.com/apache/logging-log4j2/pull/641#discussion_r771879822



##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java
##########
@@ -22,11 +22,13 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Properties;
 
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.ConfigurationAware;
+import org.apache.logging.log4j.status.StatusLogger;
 import org.apache.logging.log4j.util.Strings;

Review comment:
       I back ported the entirety of StrSubstitutor from release-2.x

##########
File path: log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java
##########
@@ -22,11 +22,13 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Properties;
 
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.Configuration;
 import org.apache.logging.log4j.core.config.ConfigurationAware;
+import org.apache.logging.log4j.status.StatusLogger;
 import org.apache.logging.log4j.util.Strings;

Review comment:
       I backported the entirety of StrSubstitutor from release-2.x




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