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 17:00:12 UTC

[logging-log4j2] branch master updated (b6c5fcc -> 7ed1396)

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

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


    from b6c5fcc  Better test setup.
     new 6dbc9f7  [LOG4J2-3328] Log4j 1.2 bridge does not support system properties in log4j.xml.
     new 7ed1396  [LOG4J2-3330] Configurator.setLevel not fetching the correct LoggerContext.

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] 02/02: [LOG4J2-3330] Configurator.setLevel not fetching the correct LoggerContext.

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

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

commit 7ed139634967f091c700fbc22c73d65f7af5cff9
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 16 12:00:00 2022 -0500

    [LOG4J2-3330] Configurator.setLevel not fetching the correct
    LoggerContext.
---
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 20b8e83..1e489da 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -266,6 +266,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" issue="LOG4J2-3330" due-to="Mircea Lemnaru, Gary Gregory">
         Configurator.setLevel not fetching the correct LoggerContext.
       </action>

[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 master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 6dbc9f74f70e57101e8971fad8984cd02aa6c401
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 2b88bb1..ab8352b 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 a56c0af..df02f23 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.core.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>