You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2020/08/02 20:45:44 UTC

[logging-log4j2] branch release-2.x updated (7d1cded -> 1a0499f)

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

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


    from 7d1cded  LOG4J2-2894 - Fix spelling error in log line
     new 86abef0  LOG4J2-2822 - Javadoc link in ThreadContext description was incorrect
     new 1a0499f  Unit test might create less than 3 files on first and last directory.

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:
 .../java/org/apache/logging/log4j/ThreadContext.java   |  3 ++-
 .../rolling/RollingDirectSizeTimeNewDirectoryTest.java | 18 +++++++++++-------
 src/changes/changes.xml                                |  3 +++
 3 files changed, 16 insertions(+), 8 deletions(-)


[logging-log4j2] 01/02: LOG4J2-2822 - Javadoc link in ThreadContext description was incorrect

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

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

commit 86abef00503a05639b01e22651d39dd05042065c
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sun Aug 2 13:44:35 2020 -0700

    LOG4J2-2822 - Javadoc link in ThreadContext description was incorrect
---
 log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java | 3 ++-
 src/changes/changes.xml                                             | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
index 18471b7..d643cd9 100644
--- a/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
@@ -42,7 +42,8 @@ import org.apache.logging.log4j.util.PropertiesUtil;
  * The ThreadContext allows applications to store information either in a Map or a Stack.
  * <p>
  * <b><em>The MDC is managed on a per thread basis</em></b>. To enable automatic inheritance of <i>copies</i> of the MDC
- * to newly created threads, enable the {@value DefaultThreadContextMap#INHERITABLE_MAP} Log4j system property.
+ * to newly created threads, enable the {@value org.apache.logging.log4j.spi.DefaultThreadContextMap#INHERITABLE_MAP}
+ * Log4j system property.
  * </p>
  * @see <a href="https://logging.apache.org/log4j/2.x/manual/thread-context.html">Thread Context Manual</a>
  */
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index eaad7af..5420541 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -30,6 +30,9 @@
          - "remove" - Removed
     -->
     <release version="2.14.0" date="2020-MM-DD" description="GA Release 2.14.0">
+      <action issue="LOG4J2-2822" dev="rgoers" type="fix">
+        Javadoc link in ThreadContext description was incorrect.
+      </action>
       <action issue="LOG4J2-2894" dev="rgoers" type="fix">
         Fix spelling error in log message.
       </action>


[logging-log4j2] 02/02: Unit test might create less than 3 files on first and last directory.

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

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

commit 1a0499f0b1c9055aa8fbcfc11e44a28bef282255
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sun Aug 2 13:45:19 2020 -0700

    Unit test might create less than 3 files on first and last directory.
---
 .../rolling/RollingDirectSizeTimeNewDirectoryTest.java | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingDirectSizeTimeNewDirectoryTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingDirectSizeTimeNewDirectoryTest.java
index a9d3ee5..9978aa8 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingDirectSizeTimeNewDirectoryTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingDirectSizeTimeNewDirectoryTest.java
@@ -24,6 +24,7 @@ import org.junit.Test;
 import org.junit.rules.RuleChain;
 
 import java.io.File;
+import java.util.Arrays;
 import java.util.List;
 
 import static java.util.Arrays.asList;
@@ -69,17 +70,20 @@ public class RollingDirectSizeTimeNewDirectoryTest {
         assertNotNull(loggingFolders);
         // Check if two folders were created
         assertTrue("Not enough directories created", loggingFolders.length >= 2);
-        for (File dir : loggingFolders) {
+        Arrays.sort(loggingFolders);
+        for (int i = 0; i < loggingFolders.length; ++i) {
+            File dir = loggingFolders[i];
             File[] files = dir.listFiles();
             assertTrue("No files in directory " + dir.toString(), files != null && files.length > 0);
-            if (files.length < 3) {
-                System.out.println("Only " + files.length + " files created in " + dir.toString());
-                for (File logFile : files) {
-                    System.out.println("File name: " + logFile.getName() + " size: " + logFile.length());
+            if (i > 0 && i < loggingFolders.length - 1) {
+                if (files.length < 3) {
+                    System.out.println("Only " + files.length + " files created in " + dir.toString());
+                    for (File logFile : files) {
+                        System.out.println("File name: " + logFile.getName() + " size: " + logFile.length());
+                    }
+                    fail();
                 }
-                fail();
             }
-
         }
     }
 }