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 2022/12/29 19:21:02 UTC

[logging-log4j2] branch release-2.x updated (2fc1f328a2 -> 02ef333d56)

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 2fc1f328a2 LOG4J2-3644 - Deprecate package scanning
     add 4575d54575 Correctly default to not include location info for AsyncRootLoggers LOG4J2-3487
     new 8044c98404 Disclose relationship with TideLift
     new 53d5b2ffdc Rollback previous commit
     new 8abcf751bd Check urlConnection for being instance of JarURLConnection instead of relying on protocol name
     new 7b4bf76ec0 Run mvn spotless:apply
     new 728c99e420 Fix NPE in Log4jMarker
     new ea4cf759bc LOG4J2-3644 - Deprecate package scanning
     new 02ef333d56 Merge branch 'davemessink-release-2.x' into release-2.x

The 7 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/async/AsyncLoggerDefaultLocationTest.java      |  4 ----
 ...ationTest.java => AsyncRootLoggerDefaultLocationTest.java} | 11 +++--------
 ...ocationTest.xml => AsyncRootLoggerDefaultLocationTest.xml} |  8 +++-----
 .../apache/logging/log4j/core/async/AsyncLoggerConfig.java    |  3 ++-
 src/changes/changes.xml                                       |  3 +++
 5 files changed, 11 insertions(+), 18 deletions(-)
 copy log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/{AsyncLoggerDefaultLocationTest.java => AsyncRootLoggerDefaultLocationTest.java} (90%)
 copy log4j-core-test/src/test/resources/{AsyncLoggerDefaultLocationTest.xml => AsyncRootLoggerDefaultLocationTest.xml} (72%)


[logging-log4j2] 07/07: Merge branch 'davemessink-release-2.x' into release-2.x

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 02ef333d56303c40bc56ce34b25f0d5e198a12e5
Merge: 2fc1f328a2 ea4cf759bc
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Thu Dec 29 12:20:29 2022 -0700

    Merge branch 'davemessink-release-2.x' into release-2.x

 .../core/async/AsyncLoggerDefaultLocationTest.java     |  4 ----
 ...st.java => AsyncRootLoggerDefaultLocationTest.java} | 11 +++--------
 .../resources/AsyncRootLoggerDefaultLocationTest.xml   | 18 ++++++++++++++++++
 .../logging/log4j/core/async/AsyncLoggerConfig.java    |  3 ++-
 src/changes/changes.xml                                |  3 +++
 5 files changed, 26 insertions(+), 13 deletions(-)


[logging-log4j2] 02/07: Rollback previous commit

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 53d5b2ffdc6af742a012868950810eadb476c7cd
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Sun Dec 4 22:31:58 2022 +0100

    Rollback previous commit
---
 src/site/markdown/support.md | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/src/site/markdown/support.md b/src/site/markdown/support.md
index faa85a37c6..78024dd24f 100644
--- a/src/site/markdown/support.md
+++ b/src/site/markdown/support.md
@@ -49,16 +49,3 @@ projects, we cannot recommend any particular individual for any specific issue.
 * [Ralph Goers](https://github.com/rgoers)
 * [Volkan Yazıcı](https://github.com/vy)
 * [Carter Kozak](https://github.com/carterkozak)
-
-## Third-party commercial support
-
-While neither the Apache Software Foundation nor the Apache Logging Services project provide any commercial support for
-the Log4j products individual committers may collaborate with services that provide such support.
-
-The following aims to be a list of all commercial support services involving one or more Log4j committers.
-
-### TideLift
-
-Some Log4j maintainers are working with Tidelift to deliver commercial support and maintenance for the Open Source
-dependencies you use to build your applications. Learn more on the [TideLift website](https://tidelift.com).
-


[logging-log4j2] 04/07: Run mvn spotless:apply

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 7b4bf76ec08f44308dff30d5590e9bfce7597720
Author: raipc <an...@axibase.com>
AuthorDate: Fri Dec 9 10:51:27 2022 +0100

    Run mvn spotless:apply
---
 .../logging/log4j/core/config/ConfigurationSource.java     | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
index 19aa4adc10..2562d30f4a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
@@ -14,7 +14,6 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
-
 package org.apache.logging.log4j.core.config;
 
 import java.io.ByteArrayInputStream;
@@ -34,19 +33,12 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.Objects;
 
-import javax.net.ssl.HttpsURLConnection;
-
 import org.apache.logging.log4j.core.net.UrlConnectionFactory;
-import org.apache.logging.log4j.core.net.ssl.LaxHostnameVerifier;
-import org.apache.logging.log4j.core.net.ssl.SslConfiguration;
-import org.apache.logging.log4j.core.net.ssl.SslConfigurationFactory;
-import org.apache.logging.log4j.core.util.AuthorizationProvider;
 import org.apache.logging.log4j.core.util.FileUtils;
 import org.apache.logging.log4j.core.util.Loader;
 import org.apache.logging.log4j.core.util.Source;
 import org.apache.logging.log4j.util.Constants;
 import org.apache.logging.log4j.util.LoaderUtil;
-import org.apache.logging.log4j.util.PropertiesUtil;
 
 /**
  * Represents the source for the logging configuration.
@@ -209,15 +201,15 @@ public class ConfigurationSource {
     private boolean isFile() {
         return source == null ? false : source.getFile() != null;
     }
-    
+
     private boolean isURL() {
         return source == null ? false : source.getURI() != null;
     }
-    
+
     private boolean isLocation() {
         return source == null ? false : source.getLocation() != null;
     }
-    
+
     /**
      * Returns the configuration source URL, or {@code null} if this configuration source is based on a file or has
      * neither a file nor an URL.


[logging-log4j2] 06/07: LOG4J2-3644 - Deprecate package scanning

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 ea4cf759bcd680de489808a1827d78448c7bc11b
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Mon Dec 26 21:27:28 2022 -0700

    LOG4J2-3644 - Deprecate package scanning
---
 .../core/config/plugins/util/PluginManager.java    | 16 ++++--
 src/site/xdoc/manual/appenders.xml                 | 60 +++++++++++-----------
 src/site/xdoc/manual/configuration.xml.vm          |  5 +-
 src/site/xdoc/manual/filters.xml                   | 30 +++++------
 src/site/xdoc/manual/plugins.xml                   |  6 +--
 5 files changed, 63 insertions(+), 54 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
index abe2aa91be..8dae9cc3d4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/PluginManager.java
@@ -14,13 +14,8 @@
  * See the license for the specific language governing permissions and
  * limitations under the license.
  */
-
 package org.apache.logging.log4j.core.config.plugins.util;
 
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.status.StatusLogger;
-import org.apache.logging.log4j.util.Strings;
-
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -28,6 +23,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.status.StatusLogger;
+import org.apache.logging.log4j.util.Strings;
+
 /**
  * Loads and manages all the plugins.
  */
@@ -125,6 +124,9 @@ public class PluginManager {
      * @since 2.1
      */
     public void collectPlugins(final List<String> packages) {
+        if (isNotEmpty(packages) || isNotEmpty(PACKAGES)) {
+            LOGGER.warn("The use of package scanning to locate plugins is deprecated and will be removed in a future release");
+        }
         final String categoryLowerCase = category.toLowerCase();
         final Map<String, PluginType<?>> newPlugins = new LinkedHashMap<>();
 
@@ -173,4 +175,8 @@ public class PluginManager {
             }
         }
     }
+
+    private boolean isNotEmpty(List<String> list) {
+        return list != null && !list.isEmpty();
+    }
 }
diff --git a/src/site/xdoc/manual/appenders.xml b/src/site/xdoc/manual/appenders.xml
index 02b59dfb25..37790b0ade 100644
--- a/src/site/xdoc/manual/appenders.xml
+++ b/src/site/xdoc/manual/appenders.xml
@@ -158,7 +158,7 @@
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <File name="MyFile" fileName="logs/app.log">
       <PatternLayout>
@@ -471,7 +471,7 @@ CREATE TABLE logs (
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
       <PatternLayout pattern="%m%n"/>
@@ -540,7 +540,7 @@ CREATE TABLE logs (
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log" filePattern="logs/app-%d{MM-dd-yyyy}.log.gz"
                  ignoreExceptions="false">
@@ -701,7 +701,7 @@ CREATE TABLE logs (
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <File name="MyFile" fileName="logs/app.log">
       <PatternLayout>
@@ -887,7 +887,7 @@ CREATE TABLE logs (
             </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Flume name="eventLogger" compress="true">
       <Agent host="192.168.10.101" port="8800"/>
@@ -907,7 +907,7 @@ CREATE TABLE logs (
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Flume name="eventLogger" compress="true" type="persistent" dataDir="./logData">
       <Agent host="192.168.10.101" port="8800"/>
@@ -928,7 +928,7 @@ CREATE TABLE logs (
             Agent.
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Flume name="eventLogger" compress="true" type="Embedded">
       <Agent host="192.168.10.101" port="8800"/>
@@ -954,7 +954,7 @@ CREATE TABLE logs (
             events to an embedded Flume Agent.
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="error" name="MyApp" packages="">
+<Configuration status="error" name="MyApp">
   <Appenders>
     <Flume name="eventLogger" compress="true" type="Embedded">
       <Property name="channels">file</Property>
@@ -2237,7 +2237,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
         </p>
 
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <MemoryMappedFile name="MyFile" fileName="logs/app.log">
       <PatternLayout>
@@ -2820,7 +2820,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
         </p>
 
 					<pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RandomAccessFile name="MyFile" fileName="logs/app.log">
       <PatternLayout>
@@ -2915,7 +2915,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
       <PatternLayout pattern="%m%n"/>
@@ -2957,7 +2957,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             to the MapMessage:
           </p>
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
       <PatternLayout pattern="%m%n"/>
@@ -3520,7 +3520,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
@@ -3543,7 +3543,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             This second example shows a rollover strategy that will keep up to 20 files before removing them.
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
@@ -3571,7 +3571,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
@@ -3597,7 +3597,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" filePattern="logs/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
       <PatternLayout>
@@ -3620,7 +3620,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" filePattern="logs/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
       <PatternLayout>
@@ -3857,7 +3857,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Properties>
     <Property name="baseDir">logs</Property>
   </Properties>
@@ -3892,7 +3892,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Properties>
     <Property name="baseDir">logs</Property>
   </Properties>
@@ -3998,7 +3998,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="trace" name="MyApp" packages="">
+<Configuration status="trace" name="MyApp">
   <Properties>
     <Property name="baseDir">logs</Property>
   </Properties>
@@ -4121,7 +4121,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="trace" name="MyApp" packages="">
+<Configuration status="trace" name="MyApp">
   <Properties>
     <Property name="baseDir">logs</Property>
   </Properties>
@@ -4339,7 +4339,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
         </p>
 
 					<pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingRandomAccessFile name="RollingRandomAccessFile" fileName="logs/app.log"
                  filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
@@ -4363,7 +4363,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
 					20 files before removing them.
         </p>
 					<pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingRandomAccessFile name="RollingRandomAccessFile" fileName="logs/app.log"
                  filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
@@ -4398,7 +4398,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
         </p>
 
 					<pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingRandomAccessFile name="RollingRandomAccessFile" fileName="logs/app.log"
                  filePattern="logs/$${date:yyyy-MM}/app-%d{yyyy-MM-dd-HH}-%i.log.gz">
@@ -4641,7 +4641,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Flume name="AuditLogger" compress="true">
       <Agent host="192.168.10.101" port="8800"/>
@@ -4796,7 +4796,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             </tr>
           </table>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <SMTP name="Mail" subject="Error Log" to="errors@logging.apache.org" from="test@logging.apache.org"
           smtpHost="localhost" smtpPort="25" bufferSize="50">
@@ -4952,7 +4952,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             This is an unsecured TCP configuration:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Socket name="socket" host="localhost" port="9500">
       <JsonLayout properties="true"/>
@@ -4969,7 +4969,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
             This is a secured <a href="#SSL">SSL</a> configuration:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Socket name="socket" host="localhost" port="9500">
       <JsonLayout properties="true"/>
@@ -5332,7 +5332,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Syslog name="bsd" host="localhost" port="514" protocol="TCP"/>
     <Syslog name="RFC5424" format="RFC5424" host="localhost" port="8514"
@@ -5356,7 +5356,7 @@ public class JpaLogEntity extends AbstractLogEventWrapperEntity {
           </p>
 
             <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <Syslog name="bsd" host="localhost" port="6514" protocol="SSL">
       <SSL>
diff --git a/src/site/xdoc/manual/configuration.xml.vm b/src/site/xdoc/manual/configuration.xml.vm
index d616103781..b55edd02d0 100644
--- a/src/site/xdoc/manual/configuration.xml.vm
+++ b/src/site/xdoc/manual/configuration.xml.vm
@@ -594,7 +594,10 @@ public class Bar {
               </tr>
               <tr>
                 <td>packages</td>
-                <td>A comma separated list of package names to search for plugins. Plugins are only loaded
+                <td><b>Use of the packages attribute is deprecated and will be removed in Log4j 3.0.</b> Plugins
+                  should be processed with the Log4j annotation processor.
+
+                  A comma separated list of package names to search for plugins. Plugins are only loaded
                   once per classloader so changing this value may not have any effect upon reconfiguration.</td>
               </tr>
               <tr>
diff --git a/src/site/xdoc/manual/filters.xml b/src/site/xdoc/manual/filters.xml
index 4095188964..2714e96636 100644
--- a/src/site/xdoc/manual/filters.xml
+++ b/src/site/xdoc/manual/filters.xml
@@ -102,7 +102,7 @@
             A configuration containing the BurstFilter might look like:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -131,7 +131,7 @@
             A configuration containing the CompositeFilter might look like:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Filters>
     <MarkerFilter marker="EVENT" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
     <DynamicThresholdFilter key="loginId" defaultThreshold="ERROR"
@@ -214,7 +214,7 @@
             Here is a sample configuration containing the DynamicThresholdFilter:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp" >
   <DynamicThresholdFilter key="loginId" defaultThreshold="ERROR"
                           onMatch="ACCEPT" onMismatch="NEUTRAL">
     <KeyValuePair key="User1" value="DEBUG"/>
@@ -277,7 +277,7 @@
             As in this configuration, the MapFilter can be used to log particular events:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <MapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
     <KeyValuePair key="eventId" value="Login"/>
     <KeyValuePair key="eventId" value="Logout"/>
@@ -303,7 +303,7 @@
             logger configured is the root.
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -330,7 +330,7 @@
             logger configured is the root and the root is only configured with a single appender reference.
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -390,7 +390,7 @@
             A sample configuration that only allows the event to be written by the appender if the Marker matches:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -458,7 +458,7 @@
             A configuration containing the MutableContextMapFilter might look like:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <MutableContextMapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or"
     configLocation="http://localhost:8080/threadContextFilter.json" pollInterval="300">
   </MutableContextMapFilter>
@@ -520,7 +520,7 @@
             appender if no marker is there:</p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log" filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
       <NoMarkerFilter onMatch="ACCEPT" onMismatch="DENY"/>
@@ -577,7 +577,7 @@
             "test":
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -764,7 +764,7 @@
             As in this configuration, the StructuredDataFilter can be used to log particular events:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <StructuredDataFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
     <KeyValuePair key="id" value="Login"/>
     <KeyValuePair key="id" value="Logout"/>
@@ -828,7 +828,7 @@
             A configuration containing the ContextMapFilter might look like:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <ContextMapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
     <KeyValuePair key="User1" value="DEBUG"/>
     <KeyValuePair key="User2" value="WARN"/>
@@ -853,7 +853,7 @@
             The ContextMapFilter can also be applied to a logger for filtering:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -914,7 +914,7 @@
             A sample configuration that only allows the event to be written by the appender if the level matches:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
@@ -983,7 +983,7 @@
             day using the default timezone:
           </p>
           <pre class="prettyprint linenums"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp" packages="">
+<Configuration status="warn" name="MyApp">
   <Appenders>
     <RollingFile name="RollingFile" fileName="logs/app.log"
                  filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
diff --git a/src/site/xdoc/manual/plugins.xml b/src/site/xdoc/manual/plugins.xml
index 3254129360..094672b71a 100644
--- a/src/site/xdoc/manual/plugins.xml
+++ b/src/site/xdoc/manual/plugins.xml
@@ -50,11 +50,11 @@
               the build (more details below).</li>
             <li>(OSGi only) Serialized plugin listing files in each active OSGi bundle. A <code>BundleListener</code>
               is added on activation to continue checking new bundles after <code>log4j-core</code> has started.</li>
-            <li>A comma-separated list of packages specified by the <code>log4j.plugin.packages</code>
+            <li><b>(Deprecated)</b> A comma-separated list of packages specified by the <code>log4j.plugin.packages</code>
               system property.</li>
-            <li>Packages passed to the static <code>PluginManager.addPackages</code> method (before Log4j configuration
+            <li><b>(Deprecated)</b> Packages passed to the static <code>PluginManager.addPackages</code> method (before Log4j configuration
               occurs).</li>
-            <li>The <a href="./configuration.html#ConfigurationSyntax">packages</a> declared in your log4j2
+            <li><b>(Deprecated)</b> The <a href="./configuration.html#ConfigurationSyntax">packages</a> declared in your log4j2
               configuration file.</li>
           </ol>
           <p>


[logging-log4j2] 05/07: Fix NPE in Log4jMarker

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 728c99e42092fe13d7ba52f8567dccce64ae544b
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Sun Dec 25 22:30:27 2022 +0100

    Fix NPE in Log4jMarker
    
    Log4j2's Marker#getParents() does actually return `null` instead of an
    empty array.
---
 .../java/org/apache/logging/slf4j/Log4jMarker.java | 75 +++++++++++-----------
 .../java/org/apache/logging/slf4j/Log4jMarker.java | 75 +++++++++++-----------
 2 files changed, 76 insertions(+), 74 deletions(-)

diff --git a/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java b/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java
index fb21659103..bb1621aa39 100644
--- a/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java
+++ b/log4j-slf4j-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java
@@ -17,6 +17,7 @@
 package org.apache.logging.slf4j;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
@@ -47,43 +48,40 @@ class Log4jMarker implements Marker {
 
     @Override
     public void add(final Marker marker) {
-		if (marker == null) {
-			throw new IllegalArgumentException();
-		}
+        if (marker == null) {
+            throw new IllegalArgumentException();
+        }
         final Marker m = factory.getMarker(marker.getName());
         this.marker.addParents(((Log4jMarker)m).getLog4jMarker());
     }
 
     @Override
-	public boolean contains(final Marker marker) {
-		if (marker == null) {
-			throw new IllegalArgumentException();
-		}
-		return this.marker.isInstanceOf(marker.getName());
-	}
+    public boolean contains(final Marker marker) {
+        if (marker == null) {
+            throw new IllegalArgumentException();
+        }
+        return this.marker.isInstanceOf(marker.getName());
+    }
 
     @Override
-	public boolean contains(final String s) {
-		return s != null ? this.marker.isInstanceOf(s) : false;
-	}
+    public boolean contains(final String s) {
+        return s != null ? this.marker.isInstanceOf(s) : false;
+    }
 
     @Override
-	public boolean equals(final Object obj) {
-		if (this == obj) {
-			return true;
-		}
-		if (obj == null) {
-			return false;
-		}
-		if (!(obj instanceof Log4jMarker)) {
-			return false;
-		}
-		final Log4jMarker other = (Log4jMarker) obj;
-		if (!Objects.equals(marker, other.marker)) {
-			return false;
-		}
-		return true;
-	}
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (!(obj instanceof Log4jMarker)) {
+            return false;
+        }
+        final Log4jMarker other = (Log4jMarker) obj;
+        return Objects.equals(marker, other.marker);
+    }
 
     public org.apache.logging.log4j.Marker getLog4jMarker() {
         return marker;
@@ -100,27 +98,30 @@ class Log4jMarker implements Marker {
     }
 
     @Override
-	public int hashCode() {
-		return 31 + Objects.hashCode(marker);
-	}
+    public int hashCode() {
+        return 31 + Objects.hashCode(marker);
+    }
 
     @Override
     public boolean hasReferences() {
         return marker.hasParents();
     }
 
-	@Override
+    @Override
     public Iterator<Marker> iterator() {
         final org.apache.logging.log4j.Marker[] log4jParents = this.marker.getParents();
+        if (log4jParents == null) {
+            return Collections.emptyIterator();
+        }
         final List<Marker> parents = new ArrayList<>(log4jParents.length);
-		for (final org.apache.logging.log4j.Marker m : log4jParents) {
+        for (final org.apache.logging.log4j.Marker m : log4jParents) {
             parents.add(factory.getMarker(m.getName()));
         }
         return parents.iterator();
     }
 
-	@Override
-	public boolean remove(final Marker marker) {
-		return marker != null ? this.marker.remove(MarkerManager.getMarker(marker.getName())) : false;
-	}
+    @Override
+    public boolean remove(final Marker marker) {
+        return marker != null ? this.marker.remove(MarkerManager.getMarker(marker.getName())) : false;
+    }
 }
diff --git a/log4j-slf4j2-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java b/log4j-slf4j2-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java
index fb21659103..bb1621aa39 100644
--- a/log4j-slf4j2-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java
+++ b/log4j-slf4j2-impl/src/main/java/org/apache/logging/slf4j/Log4jMarker.java
@@ -17,6 +17,7 @@
 package org.apache.logging.slf4j;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Objects;
@@ -47,43 +48,40 @@ class Log4jMarker implements Marker {
 
     @Override
     public void add(final Marker marker) {
-		if (marker == null) {
-			throw new IllegalArgumentException();
-		}
+        if (marker == null) {
+            throw new IllegalArgumentException();
+        }
         final Marker m = factory.getMarker(marker.getName());
         this.marker.addParents(((Log4jMarker)m).getLog4jMarker());
     }
 
     @Override
-	public boolean contains(final Marker marker) {
-		if (marker == null) {
-			throw new IllegalArgumentException();
-		}
-		return this.marker.isInstanceOf(marker.getName());
-	}
+    public boolean contains(final Marker marker) {
+        if (marker == null) {
+            throw new IllegalArgumentException();
+        }
+        return this.marker.isInstanceOf(marker.getName());
+    }
 
     @Override
-	public boolean contains(final String s) {
-		return s != null ? this.marker.isInstanceOf(s) : false;
-	}
+    public boolean contains(final String s) {
+        return s != null ? this.marker.isInstanceOf(s) : false;
+    }
 
     @Override
-	public boolean equals(final Object obj) {
-		if (this == obj) {
-			return true;
-		}
-		if (obj == null) {
-			return false;
-		}
-		if (!(obj instanceof Log4jMarker)) {
-			return false;
-		}
-		final Log4jMarker other = (Log4jMarker) obj;
-		if (!Objects.equals(marker, other.marker)) {
-			return false;
-		}
-		return true;
-	}
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (!(obj instanceof Log4jMarker)) {
+            return false;
+        }
+        final Log4jMarker other = (Log4jMarker) obj;
+        return Objects.equals(marker, other.marker);
+    }
 
     public org.apache.logging.log4j.Marker getLog4jMarker() {
         return marker;
@@ -100,27 +98,30 @@ class Log4jMarker implements Marker {
     }
 
     @Override
-	public int hashCode() {
-		return 31 + Objects.hashCode(marker);
-	}
+    public int hashCode() {
+        return 31 + Objects.hashCode(marker);
+    }
 
     @Override
     public boolean hasReferences() {
         return marker.hasParents();
     }
 
-	@Override
+    @Override
     public Iterator<Marker> iterator() {
         final org.apache.logging.log4j.Marker[] log4jParents = this.marker.getParents();
+        if (log4jParents == null) {
+            return Collections.emptyIterator();
+        }
         final List<Marker> parents = new ArrayList<>(log4jParents.length);
-		for (final org.apache.logging.log4j.Marker m : log4jParents) {
+        for (final org.apache.logging.log4j.Marker m : log4jParents) {
             parents.add(factory.getMarker(m.getName()));
         }
         return parents.iterator();
     }
 
-	@Override
-	public boolean remove(final Marker marker) {
-		return marker != null ? this.marker.remove(MarkerManager.getMarker(marker.getName())) : false;
-	}
+    @Override
+    public boolean remove(final Marker marker) {
+        return marker != null ? this.marker.remove(MarkerManager.getMarker(marker.getName())) : false;
+    }
 }


[logging-log4j2] 03/07: Check urlConnection for being instance of JarURLConnection instead of relying on protocol name

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 8abcf751bd688e128504c4f8d00825a1646da66a
Author: raipc <an...@axibase.com>
AuthorDate: Fri Dec 9 02:22:22 2022 +0100

    Check urlConnection for being instance of JarURLConnection instead of relying on protocol name
---
 .../org/apache/logging/log4j/core/config/ConfigurationSource.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
index 48d7d5aa9a..19aa4adc10 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationSource.java
@@ -62,8 +62,6 @@ public class ConfigurationSource {
      * ConfigurationSource to use with {@link org.apache.logging.log4j.core.config.composite.CompositeConfiguration}.
      */
     public static final ConfigurationSource COMPOSITE_SOURCE = new ConfigurationSource(Constants.EMPTY_BYTE_ARRAY, null, 0);
-    private static final String HTTPS = "https";
-    private static final String JAR = "jar";
 
     private final InputStream stream;
     private volatile byte[] data;
@@ -367,7 +365,7 @@ public class ConfigurationSource {
             try {
                 if (file != null) {
                     return new ConfigurationSource(urlConnection.getInputStream(), FileUtils.fileFromUri(url.toURI()));
-                } else if (JAR.equals(url.getProtocol())) {
+                } else if (urlConnection instanceof JarURLConnection) {
                     // Work around https://bugs.openjdk.java.net/browse/JDK-6956385.
                     long lastModified = new File(((JarURLConnection)urlConnection).getJarFile().getName())
                             .lastModified();


[logging-log4j2] 01/07: Disclose relationship with TideLift

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 8044c98404fce76730ed192d5b43362387331f41
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Sun Dec 4 22:28:52 2022 +0100

    Disclose relationship with TideLift
---
 src/site/markdown/support.md | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/site/markdown/support.md b/src/site/markdown/support.md
index 78024dd24f..faa85a37c6 100644
--- a/src/site/markdown/support.md
+++ b/src/site/markdown/support.md
@@ -49,3 +49,16 @@ projects, we cannot recommend any particular individual for any specific issue.
 * [Ralph Goers](https://github.com/rgoers)
 * [Volkan Yazıcı](https://github.com/vy)
 * [Carter Kozak](https://github.com/carterkozak)
+
+## Third-party commercial support
+
+While neither the Apache Software Foundation nor the Apache Logging Services project provide any commercial support for
+the Log4j products individual committers may collaborate with services that provide such support.
+
+The following aims to be a list of all commercial support services involving one or more Log4j committers.
+
+### TideLift
+
+Some Log4j maintainers are working with Tidelift to deliver commercial support and maintenance for the Open Source
+dependencies you use to build your applications. Learn more on the [TideLift website](https://tidelift.com).
+