You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2022/01/16 16:56:23 UTC

[logging-log4j2] branch release-2.x updated (c2352ab -> 7cee696)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git.


    from c2352ab  Better test setup.
     new bb2cd1e  [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in log4j.xml.
     new 7cee696  [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in log4j.xml.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/org/apache/log4j/builders/AbstractBuilder.java  |  2 +-
 .../org/apache/log4j/config/XmlRollingWithPropertiesTest.java | 11 +++++------
 .../src/test/resources/log4j1-rolling-properties.xml          |  2 +-
 src/changes/changes.xml                                       |  3 +++
 4 files changed, 10 insertions(+), 8 deletions(-)

[logging-log4j2] 01/02: [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in log4j.xml.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit bb2cd1e2cca26b9a5332023d460da34f22efba6b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 16 11:56:13 2022 -0500

    [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in
    log4j.xml.
---
 .../main/java/org/apache/log4j/builders/AbstractBuilder.java  |  2 +-
 .../org/apache/log4j/config/XmlRollingWithPropertiesTest.java | 11 +++++------
 .../src/test/resources/log4j1-rolling-properties.xml          |  2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/builders/AbstractBuilder.java b/log4j-1.2-api/src/main/java/org/apache/log4j/builders/AbstractBuilder.java
index 72fb985..bbb8bd7 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/builders/AbstractBuilder.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/builders/AbstractBuilder.java
@@ -87,7 +87,7 @@ public abstract class AbstractBuilder {
     }
 
     protected String getValueAttribute(Element element) {
-        return element.getAttribute(VALUE_ATTR);
+        return substVars(element.getAttribute(VALUE_ATTR));
     }
 
     public boolean getBooleanProperty(String key) {
diff --git a/log4j-1.2-api/src/test/java/org/apache/log4j/config/XmlRollingWithPropertiesTest.java b/log4j-1.2-api/src/test/java/org/apache/log4j/config/XmlRollingWithPropertiesTest.java
index 858ba68..ba779ad 100644
--- a/log4j-1.2-api/src/test/java/org/apache/log4j/config/XmlRollingWithPropertiesTest.java
+++ b/log4j-1.2-api/src/test/java/org/apache/log4j/config/XmlRollingWithPropertiesTest.java
@@ -26,7 +26,6 @@ import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.logging.log4j.test.SystemPropertyTestRule;
 import org.junit.ClassRule;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TestRule;
@@ -34,7 +33,6 @@ import org.junit.rules.TestRule;
 /**
  * Test configuration from Properties.
  */
-@Ignore
 public class XmlRollingWithPropertiesTest {
 
     private static final String TEST_DIR = "target/" + XmlRollingWithPropertiesTest.class.getSimpleName();
@@ -49,11 +47,12 @@ public class XmlRollingWithPropertiesTest {
     @Test
     public void testProperties() throws Exception {
         // ${test.directory}/logs/etl.log
-        Logger logger = LogManager.getLogger("test");
+        final Path path = Paths.get(TEST_DIR, "logs/etl.log");
+        Files.deleteIfExists(path);
+        final Logger logger = LogManager.getLogger("test");
         logger.debug("This is a test of the root logger");
-        Path path = Paths.get(TEST_DIR, "logs/etl.log");
-        assertTrue("Log file was not created", Files.exists(path));
-        assertTrue("Log file is empty", Files.size(path) > 0);
+        assertTrue("Log file was not created " + path, Files.exists(path));
+        assertTrue("Log file is empty " + path, Files.size(path) > 0);
     }
 
 }
diff --git a/log4j-1.2-api/src/test/resources/log4j1-rolling-properties.xml b/log4j-1.2-api/src/test/resources/log4j1-rolling-properties.xml
index a272630..f5b08aa 100644
--- a/log4j-1.2-api/src/test/resources/log4j1-rolling-properties.xml
+++ b/log4j-1.2-api/src/test/resources/log4j1-rolling-properties.xml
@@ -25,7 +25,7 @@
     </layout>
   </appender>
   <root>
-    <priority value="OFF" />
+    <priority value="DEBUG" />
     <appender-ref ref="DAILY" />
   </root>
 </log4j:configuration>

[logging-log4j2] 02/02: [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in log4j.xml.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 7cee696b86e1b6631d59d0906f082277f45a606c
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 16 11:56:19 2022 -0500

    [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in
    log4j.xml.
---
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d2c093b..9392b8c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -124,6 +124,9 @@
       <action dev="ggregory" type="fix" issue="LOG4J2-3326" due-to="Gary Gregory">
         Log4j 1.2 bridge class org.apache.log4j.spi.LoggingEvent missing constructors and public instance variable.
       </action>
+      <action dev="ggregory" type="fix" issue="LOG4J2-3328" due-to="Gary Gregory">
+        Log4j 1.2 bridge does not support system properties in log4j.xml.
+      </action>
       <action dev="ggregory" type="fix">
         JndiManager reverts to 2.17.0 behavior: Read the system property for each call.
       </action>