You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/04/11 09:01:34 UTC

[logging-log4j2] branch main updated (57af66b97e -> b789099f9d)

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

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


    from 57af66b97e LOG4J2-3658 - Allow Log4j 2 properties in JSON files
     new dd80a43887 Fix `PatternLayout.Builder#withHeader()` javadoc (#1411)
     new 3e91aac282 Fix `SimpleDateFormat`-related JDK bug URL in `FastDateParser` javadoc (#1404)
     new 6b478f6a6b Ensure `FileOutputStream` is closed in `CommonsCompressAction.execute()` (#1415)
     new b789099f9d Fix nullability docs in `StrSubstitutor` (#1422)

The 4 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:
 .../log4j/core/appender/rolling/action/CommonsCompressAction.java | 4 ++--
 .../java/org/apache/logging/log4j/core/layout/PatternLayout.java  | 2 +-
 .../java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java | 8 ++++----
 .../logging/log4j/core/time/internal/format/FastDateParser.java   | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)


[logging-log4j2] 04/04: Fix nullability docs in `StrSubstitutor` (#1422)

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

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

commit b789099f9da3a657e2cf8cd0602ce323ff43a3bd
Author: Michael Ernst <me...@alum.mit.edu>
AuthorDate: Tue Apr 11 01:36:54 2023 -0700

    Fix nullability docs in `StrSubstitutor` (#1422)
---
 .../java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java
index 6802123ba4..2f2e8436e4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/StrSubstitutor.java
@@ -1235,13 +1235,13 @@ public class StrSubstitutor implements ConfigurationAware {
      * allowing advanced prefix matches.
      * </p>
      *
-     * @param prefixMatcher  the prefix matcher to use, null ignored
+     * @param prefixMatcher  the prefix matcher to use, must not be null
      * @return this, to enable chaining
      * @throws IllegalArgumentException if the prefix matcher is null
      */
     public StrSubstitutor setVariablePrefixMatcher(final StrMatcher prefixMatcher) {
         if (prefixMatcher == null) {
-            throw new IllegalArgumentException("Variable prefix matcher must not be null!");
+            throw new IllegalArgumentException("Parameter prefixMatcher must not be null!");
         }
         this.prefixMatcher = prefixMatcher;
         return this;
@@ -1304,13 +1304,13 @@ public class StrSubstitutor implements ConfigurationAware {
      * allowing advanced suffix matches.
      * </p>
      *
-     * @param suffixMatcher  the suffix matcher to use, null ignored
+     * @param suffixMatcher  the suffix matcher to use, must not be null
      * @return this, to enable chaining
      * @throws IllegalArgumentException if the suffix matcher is null
      */
     public StrSubstitutor setVariableSuffixMatcher(final StrMatcher suffixMatcher) {
         if (suffixMatcher == null) {
-            throw new IllegalArgumentException("Variable suffix matcher must not be null!");
+            throw new IllegalArgumentException("Parameter suffixMatcher must not be null!");
         }
         this.suffixMatcher = suffixMatcher;
         return this;


[logging-log4j2] 03/04: Ensure `FileOutputStream` is closed in `CommonsCompressAction.execute()` (#1415)

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

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

commit 6b478f6a6b732b04d6c5529dcebbee49c75ca05f
Author: Michael Ernst <me...@alum.mit.edu>
AuthorDate: Tue Apr 11 01:06:35 2023 -0700

    Ensure `FileOutputStream` is closed in `CommonsCompressAction.execute()` (#1415)
---
 .../log4j/core/appender/rolling/action/CommonsCompressAction.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
index e461a8c5a6..eedc6c9ade 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
@@ -104,9 +104,9 @@ public final class CommonsCompressAction extends AbstractAction {
         }
         LOGGER.debug("Starting {} compression of {}", name, source.getPath() );
         try (final FileInputStream input = new FileInputStream(source);
+             final FileOutputStream fileOutput = new FileOutputStream(destination);
                 final BufferedOutputStream output = new BufferedOutputStream(
-                        new CompressorStreamFactory().createCompressorOutputStream(name, new FileOutputStream(
-                                destination)))) {
+                        new CompressorStreamFactory().createCompressorOutputStream(name, fileOutput))) {
             IOUtils.copy(input, output, BUF_SIZE);
             LOGGER.debug("Finished {} compression of {}", name, source.getPath() );
         } catch (final CompressorException e) {


[logging-log4j2] 02/04: Fix `SimpleDateFormat`-related JDK bug URL in `FastDateParser` javadoc (#1404)

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

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

commit 3e91aac28259ebafcf247b9856ac17a9013d8def
Author: Michael Ernst <me...@cs.washington.edu>
AuthorDate: Mon Apr 10 12:14:49 2023 -0700

    Fix `SimpleDateFormat`-related JDK bug URL in `FastDateParser` javadoc (#1404)
---
 .../apache/logging/log4j/core/time/internal/format/FastDateParser.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/format/FastDateParser.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/format/FastDateParser.java
index 6d5b76a919..18146cd3f8 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/format/FastDateParser.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/time/internal/format/FastDateParser.java
@@ -53,7 +53,7 @@ import java.util.regex.Pattern;
  * This class is especially useful in multi-threaded server environments.
  * <code>SimpleDateFormat</code> is not thread-safe in any JDK version,
  * nor will it be as Sun has closed the
- * <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4228335">bug</a>/RFE.
+ * <a href="https://bugs.openjdk.org/browse/JDK-4228335">bug</a>/RFE.
  * </p>
  *
  * <p>Only parsing is supported by this class, but all patterns are compatible with


[logging-log4j2] 01/04: Fix `PatternLayout.Builder#withHeader()` javadoc (#1411)

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

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

commit dd80a43887372cd20c13ab558730e3ab460d7b12
Author: Michael Ernst <me...@cs.washington.edu>
AuthorDate: Mon Apr 10 10:50:05 2023 -0700

    Fix `PatternLayout.Builder#withHeader()` javadoc (#1411)
---
 .../main/java/org/apache/logging/log4j/core/layout/PatternLayout.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
index 8af7ec9037..0db53d8c02 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java
@@ -659,7 +659,7 @@ public final class PatternLayout extends AbstractStringLayout {
 
         /**
          * @param header
-         *        The footer to place at the top of the document, once.
+         *        The header to place at the top of the document, once.
          */
         public Builder setHeader(final String header) {
             this.header = header;