From fc41e53ed7900abfa686b44ec9ab33bf510e34f0 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Mon, 6 Feb 2012 23:55:13 +0000
Subject: [PATCH 01/86] Make new home for Log4j2
git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1241269 13f79535-47bb-0310-9956-ffa450edef68
From d06f0a7d0eed69f58411696f579c9e4b20aaffb8 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Sun, 5 Apr 2020 20:58:06 -0700
Subject: [PATCH 02/86] LOG4J2-1360 - Add support for Platform Logger
---
log4j-jpl/pom.xml | 288 ++++++++++++++++++
.../logging/log4j/jpl/Log4jSystemLogger.java | 136 +++++++++
.../log4j/jpl/Log4jSystemLoggerAdapter.java | 43 +++
.../log4j/jpl/Log4jSystemLoggerFinder.java | 33 ++
.../services/java.lang.System$LoggerFinder | 1 +
log4j-jpl/src/site/markdown/index.md | 30 ++
log4j-jpl/src/site/site.xml | 52 ++++
.../log4j/jpl/Log4jSystemLoggerTest.java | 122 ++++++++
log4j-jpl/src/test/resources/log4j2-test.xml | 39 +++
9 files changed, 744 insertions(+)
create mode 100644 log4j-jpl/pom.xml
create mode 100644 log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
create mode 100644 log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
create mode 100644 log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
create mode 100644 log4j-jpl/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
create mode 100644 log4j-jpl/src/site/markdown/index.md
create mode 100644 log4j-jpl/src/site/site.xml
create mode 100644 log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
create mode 100644 log4j-jpl/src/test/resources/log4j2-test.xml
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
new file mode 100644
index 0000000..d0cfaca
--- /dev/null
+++ b/log4j-jpl/pom.xml
@@ -0,0 +1,288 @@
+
+
+
+
+
+ log4j
+ org.apache.logging.log4j
+ 3.0.0-SNAPSHOT
+ ../
+
+ 4.0.0
+
+
+ ${basedir}/..
+ org.apache.logging.log4j.jpl
+
+
+ log4j-jpl
+ Apache Log4j JDK Platform Logging Adapter
+ The Apache Log4j implementation of java.lang.System.LoggerFinder
+
+
+
+ org.apache.logging.log4j
+ log4j-api
+
+
+ org.apache.logging.log4j
+ log4j-core
+ test
+
+
+ org.apache.logging.log4j
+ log4j-core
+ test-jar
+ test
+
+
+ org.hamcrest
+ hamcrest-all
+ test
+
+
+ junit
+ junit
+ test
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-remote-resources-plugin
+
+
+
+ process
+
+
+ false
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+ org.apache.logging.log4j.core
+ org.apache.logging.log4j.jpl
+
+
+
+
+ org.apache.maven.plugins
+ maven-toolchains-plugin
+ 1.1
+
+
+
+ toolchain
+
+
+
+
+
+
+ [11, )
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ default-compile
+ compile
+
+ compile
+
+
+
+ default-testCompile
+ test-compile
+
+ testCompile
+
+
+
+
+ 11
+ 11
+ 11
+ none
+
+ javac
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ 2.13
+
+
+
+
+
+ test
+ test
+
+ test
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-changes-plugin
+ ${changes.plugin.version}
+
+
+
+ changes-report
+
+
+
+
+ %URL%/show_bug.cgi?id=%ISSUE%
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ ${checkstyle.plugin.version}
+
+ ${log4jParentDir}/checkstyle.xml
+ ${log4jParentDir}/checkstyle-suppressions.xml
+ false
+ basedir=${basedir}
+ licensedir=${log4jParentDir}/checkstyle-header.txt
+ **/module-info.java
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${javadoc.plugin.version}
+
+ Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.
+ Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
+ and the Apache Log4j logo are trademarks of The Apache Software Foundation.
]]>
+
+ false
+ true
+ false
+
+
+
+ non-aggregate
+
+ javadoc
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jxr-plugin
+ ${jxr.plugin.version}
+
+
+ non-aggregate
+
+ jxr
+
+
+
+ aggregate
+
+ aggregate
+
+
+
+
+
+
+
+
+ java11-module
+
+ [11,)
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ ${surefire.plugin.version}
+
+
+
+
+ test
+ test
+
+ test
+
+
+
+
+
+
+
+
+
+
+ com.github.spotbugs
+ spotbugs-maven-plugin
+
+ true
+ -Duser.language=en
+ Normal
+ Default
+ ${log4jParentDir}/spotbugs-exclude-filter.xml
+
+
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+ ${pmd.plugin.version}
+
+ ${maven.compiler.target}
+
+
+
+
+
+
+
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
new file mode 100644
index 0000000..925ca71
--- /dev/null
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.jpl;
+
+import java.lang.System.Logger;
+import java.util.MissingResourceException;
+import java.util.Objects;
+import java.util.ResourceBundle;
+import java.util.function.Supplier;
+
+import org.apache.logging.log4j.spi.ExtendedLogger;
+
+/**
+ * JPL {@link Logger logger} implementation that uses Log4j.
+ * Implement all default {@link Logger} methods to ensure proper class resolution
+ *
+ * @since 2.14
+ */
+public class Log4jSystemLogger implements Logger {
+
+ private final ExtendedLogger logger;
+
+ private static final String FQCN = Log4jSystemLogger.class.getName();
+
+ public Log4jSystemLogger(final ExtendedLogger logger) {
+ this.logger = logger;
+ }
+
+ @Override
+ public String getName() {
+ return logger.getName();
+ }
+
+ @Override
+ public boolean isLoggable(final Level level) {
+ return logger.isEnabled(getLevel(level));
+ }
+
+ @Override
+ public void log(Level level, String msg) {
+ log(level, (ResourceBundle) null, msg, (Object[]) null);
+ }
+
+ @Override
+ public void log(Level level, Supplier msgSupplier) {
+ Objects.requireNonNull(msgSupplier);
+ if (isLoggable(Objects.requireNonNull(level))) {
+ log(level, (ResourceBundle) null, msgSupplier.get(), (Object[]) null);
+ }
+ }
+
+ @Override
+ public void log(Level level, Object obj) {
+ Objects.requireNonNull(obj);
+ if (isLoggable(Objects.requireNonNull(level))) {
+ log(level, (ResourceBundle) null, obj.toString(), (Object[]) null);
+ }
+ }
+
+ @Override
+ public void log(Level level, String msg, Throwable thrown) {
+ log(level, null, msg, thrown);
+ }
+
+ @Override
+ public void log(Level level, Supplier msgSupplier, Throwable thrown) {
+ Objects.requireNonNull(msgSupplier);
+ if (isLoggable(Objects.requireNonNull(level))) {
+ log(level, null, msgSupplier.get(), thrown);
+ }
+ }
+
+ @Override
+ public void log(Level level, String format, Object... params) {
+ log(level, null, format, params);
+ }
+
+ @Override
+ public void log(final Level level, final ResourceBundle bundle, final String msg, final Throwable thrown) {
+ logger.logIfEnabled(FQCN, getLevel(level), null, getResource(bundle, msg), thrown);
+ }
+
+ @Override
+ public void log(final Level level, final ResourceBundle bundle, final String format, final Object... params) {
+ logger.logIfEnabled(FQCN, getLevel(level), null, getResource(bundle, format), params);
+ }
+
+ private static org.apache.logging.log4j.Level getLevel(final Level level) {
+ switch (level) {
+ case OFF:
+ return org.apache.logging.log4j.Level.OFF;
+ case ERROR:
+ return org.apache.logging.log4j.Level.ERROR;
+ case WARNING:
+ return org.apache.logging.log4j.Level.WARN;
+ case INFO:
+ return org.apache.logging.log4j.Level.INFO;
+ case DEBUG:
+ return org.apache.logging.log4j.Level.DEBUG;
+ case TRACE:
+ return org.apache.logging.log4j.Level.TRACE;
+ case ALL:
+ return org.apache.logging.log4j.Level.ALL;
+ }
+ return org.apache.logging.log4j.Level.ERROR;
+ }
+
+ private static String getResource(ResourceBundle bundle, String msg) {
+ if (bundle == null || msg == null) {
+ return msg;
+ }
+ try {
+ return bundle.getString(msg);
+ } catch (MissingResourceException e) {
+ // ignore
+ return msg;
+ } catch (ClassCastException ex) {
+ return bundle.getObject(msg).toString();
+ }
+ }
+}
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
new file mode 100644
index 0000000..3db9b52
--- /dev/null
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.jpl;
+
+import java.lang.System.Logger;
+import java.lang.System.LoggerFinder;
+
+import org.apache.logging.log4j.spi.AbstractLoggerAdapter;
+import org.apache.logging.log4j.spi.LoggerContext;
+import org.apache.logging.log4j.util.StackLocatorUtil;
+
+/**
+ * {@link Logger} registry implementation using just log4j-api.
+ *
+ * @since 2.14
+ */
+public class Log4jSystemLoggerAdapter extends AbstractLoggerAdapter {
+
+ @Override
+ protected Logger newLogger(String name, LoggerContext context) {
+ return new Log4jSystemLogger(context.getLogger(name));
+ }
+
+ @Override
+ protected LoggerContext getContext() {
+ return getContext(StackLocatorUtil.getCallerClass(LoggerFinder.class));
+ }
+}
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
new file mode 100644
index 0000000..cb8670d
--- /dev/null
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.jpl;
+
+import java.lang.System.Logger;
+
+/**
+ * @since 2.14
+ */
+public class Log4jSystemLoggerFinder extends System.LoggerFinder {
+
+ private final Log4jSystemLoggerAdapter loggerAdapter = new Log4jSystemLoggerAdapter();
+
+ @Override
+ public Logger getLogger(String name, Module module) {
+ return loggerAdapter.getLogger(name);
+ }
+}
diff --git a/log4j-jpl/src/main/resources/META-INF/services/java.lang.System$LoggerFinder b/log4j-jpl/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
new file mode 100644
index 0000000..b959e7e
--- /dev/null
+++ b/log4j-jpl/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
@@ -0,0 +1 @@
+org.apache.logging.log4j.jpl.Log4jSystemLoggerFinder
\ No newline at end of file
diff --git a/log4j-jpl/src/site/markdown/index.md b/log4j-jpl/src/site/markdown/index.md
new file mode 100644
index 0000000..1e5da79
--- /dev/null
+++ b/log4j-jpl/src/site/markdown/index.md
@@ -0,0 +1,30 @@
+
+
+
+# Log4j 2 JDK Platform Logging Adapter
+
+The Log4j 2 JDK Logging Adapter allow to route all System.Logger events to Log4j 2 APIs.
+
+## Requirements
+
+The JDK Platform Logging Adapter is dependent on the Log4j API as well as Java 11.
+
+## Usage
+
+Simply include the Log4j 2 JDK Platform Logging Adapter jar along with the Log4j2 jars to cause all System.Logger
+logging to be handled by Log4j 2.
diff --git a/log4j-jpl/src/site/site.xml b/log4j-jpl/src/site/site.xml
new file mode 100644
index 0000000..fccc81f
--- /dev/null
+++ b/log4j-jpl/src/site/site.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
new file mode 100644
index 0000000..ccc4b3c
--- /dev/null
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+
+package org.apache.logging.log4j.jpl;
+
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+
+import java.lang.System.Logger;
+import java.util.List;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.impl.Log4jLogEvent;
+import org.apache.logging.log4j.test.appender.ListAppender;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class Log4jSystemLoggerTest {
+
+ public static final String LOGGER_NAME = "Test";
+ protected Logger logger;
+ protected ListAppender eventAppender;
+ protected ListAppender stringAppender;
+
+ @Before
+ public void setUp() throws Exception {
+ logger = System.getLogger(LOGGER_NAME);
+ assertThat(logger, instanceOf(Log4jSystemLogger.class));
+ eventAppender = ListAppender.getListAppender("TestAppender");
+ stringAppender = ListAppender.getListAppender("StringAppender");
+ assertNotNull(eventAppender);
+ assertNotNull(stringAppender);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (eventAppender != null) {
+ eventAppender.clear();
+ }
+ if (stringAppender != null) {
+ stringAppender.clear();
+ }
+ }
+
+ @Test
+ public void testGetName() throws Exception {
+ assertThat(logger.getName(), equalTo(LOGGER_NAME));
+ }
+
+ @Test
+ public void testIsLoggable() throws Exception {
+ assertThat(logger.isLoggable(Logger.Level.ERROR), equalTo(true));
+ }
+
+ @Test
+ public void testLog() throws Exception {
+ logger.log(Logger.Level.INFO, "Informative message here.");
+ final List events = eventAppender.getEvents();
+ assertThat(events, hasSize(1));
+ final LogEvent event = events.get(0);
+ assertThat(event, instanceOf(Log4jLogEvent.class));
+ assertEquals(Level.INFO, event.getLevel());
+ assertEquals(LOGGER_NAME, event.getLoggerName());
+ assertEquals("Informative message here.", event.getMessage().getFormattedMessage());
+ assertEquals(Log4jSystemLogger.class.getName(), event.getLoggerFqcn());
+ }
+
+ @Test
+ public void testLogWithCallingClass() throws Exception {
+ final Logger log = System.getLogger("Test.CallerClass");
+ log.log(Logger.Level.INFO, "Calling from LoggerTest");
+ final List messages = stringAppender.getMessages();
+ assertThat(messages, hasSize(1));
+ final String message = messages.get(0);
+ assertEquals(Log4jSystemLoggerTest.class.getName(), message);
+ }
+
+ @Test
+ public void testCurlyBraces() {
+ testMessage("{message}");
+ }
+
+ @Test
+ public void testPercent() {
+ testMessage("message%s");
+ }
+
+ @Test
+ public void testPercentAndCurlyBraces() {
+ testMessage("message{%s}");
+ }
+
+ private void testMessage(final String string) {
+ logger.log(Logger.Level.INFO, "Test info " + string);
+ final List events = eventAppender.getEvents();
+ assertThat(events, hasSize(1));
+ for (final LogEvent event : events) {
+ final String message = event.getMessage().getFormattedMessage();
+ assertThat(message, equalTo("Test info " + string));
+ }
+ }
+}
diff --git a/log4j-jpl/src/test/resources/log4j2-test.xml b/log4j-jpl/src/test/resources/log4j2-test.xml
new file mode 100644
index 0000000..27cef64
--- /dev/null
+++ b/log4j-jpl/src/test/resources/log4j2-test.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 918ca9129ab002f7b5bddff08502a3e517c647d6 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Sun, 12 Apr 2020 16:33:52 -0700
Subject: [PATCH 03/86] Set pom to correct parent version
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index d0cfaca..6cf58c5 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 3.0.0-SNAPSHOT
+ 2.13.2-SNAPSHOT
../
4.0.0
From 0dfd3d5975034076157daac97e17c2571b339622 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Mon, 20 Apr 2020 21:36:16 -0700
Subject: [PATCH 04/86] [maven-release-plugin] prepare release log4j-2.13.2-rc1
---
log4j-jpl/pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 6cf58c5..bdde45f 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.13.2-SNAPSHOT
+ 2.13.2
../
4.0.0
@@ -245,7 +245,7 @@
${surefire.plugin.version}
-
+
test
From 0fe50157b52645858a1c95c1ecc8bcc27c48aae9 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Mon, 20 Apr 2020 21:36:38 -0700
Subject: [PATCH 05/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index bdde45f..c589fc0 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.13.2
+ 2.14.0-SNAPSHOT
../
4.0.0
From bae0d92962d8bc7e041d7fdaebdddbf9ca15aa87 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Sun, 10 May 2020 12:07:01 -0700
Subject: [PATCH 06/86] [maven-release-plugin] prepare release log4j-2.13.3-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index c589fc0..8e9e5e1 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.14.0-SNAPSHOT
+ 2.13.3
../
4.0.0
From 13c91d6632a63ac7aa4773ad546c914626d2306d Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Sun, 10 May 2020 12:07:24 -0700
Subject: [PATCH 07/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 8e9e5e1..fc24002 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.13.3
+ 2.14.0--SNAPSHOT
../
4.0.0
From ea304cec1bca010822d62636d54d3cbd7f6ae06a Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 13 May 2020 09:36:37 -0400
Subject: [PATCH 08/86] [LOG4J2-2844] Null pointer exception when no network
interfaces are available.
Also fix POM version from "2.14.0--SNAPSHOT" to "2.14.0-SNAPSHOT".
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index fc24002..c589fc0 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.14.0--SNAPSHOT
+ 2.14.0-SNAPSHOT
../
4.0.0
From 07d9475e481c54829fad98eb698326e5d8e80616 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Wed, 19 Aug 2020 11:01:03 +0200
Subject: [PATCH 09/86] #335 Initial import of JsonTemplateLayout from
LogstashLayout.
---
log4j-jpl/pom.xml | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index c589fc0..ca45baf 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -260,18 +260,6 @@
-
-
- com.github.spotbugs
- spotbugs-maven-plugin
-
- true
- -Duser.language=en
- Normal
- Default
- ${log4jParentDir}/spotbugs-exclude-filter.xml
-
-
org.apache.maven.plugins
From 59926f00b881cb1ef582342cf5f0c2179057e022 Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sun, 2 Aug 2020 15:01:34 -0500
Subject: [PATCH 10/86] [LOG4J2-2653] Add initial JUnit 5 support
This adds JUnit 5 support to most of the modules. Unchanged modules
either contain no tests or use JUnit 4 specific features that need some
adjustments to run in the JUnit vintage engine.
Backported from 3.x which includes several pom.xml modernizations as
well.
---
log4j-jpl/pom.xml | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index ca45baf..0a66699 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -58,7 +58,18 @@
junit
junit
- test
+
+
+ org.junit.vintage
+ junit-vintage-engine
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
From 31a62d6c00b5985e1344ba25a5675308bd5499c4 Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sun, 2 Aug 2020 17:07:59 -0500
Subject: [PATCH 11/86] [LOG4J2-2653] Simplify JUnit dependencies
---
log4j-jpl/pom.xml | 8 --------
1 file changed, 8 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 0a66699..9c98807 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -55,18 +55,10 @@
hamcrest-all
test
-
- junit
- junit
-
org.junit.vintage
junit-vintage-engine
-
- org.junit.jupiter
- junit-jupiter-api
-
org.junit.jupiter
junit-jupiter-engine
From d0da8cacf42ae4b5cb7f37159fa1a636fdb96bdd Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Tue, 3 Nov 2020 12:39:43 -0700
Subject: [PATCH 12/86] Only generate doap file in parent project
---
log4j-jpl/pom.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 9c98807..5405ee0 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -28,6 +28,7 @@
${basedir}/..
org.apache.logging.log4j.jpl
+ true
log4j-jpl
From dfbc43d1f5e08d14e2bd4481f020e72fa0b09733 Mon Sep 17 00:00:00 2001
From: rgoers
Date: Fri, 6 Nov 2020 14:01:50 -0700
Subject: [PATCH 13/86] [maven-release-plugin] prepare release log4j-2.14.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 5405ee0..25e0f23 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.14.0-SNAPSHOT
+ 2.14.0
../
4.0.0
From af5691d716c9a499b3e0a5e5d4b3af8b1babcd09 Mon Sep 17 00:00:00 2001
From: rgoers
Date: Fri, 6 Nov 2020 14:02:03 -0700
Subject: [PATCH 14/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 25e0f23..ee7405b 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.14.0
+ 2.14.1-SNAPSHOT
../
4.0.0
From 7f36751888906deb2da92a0857eb6bf009a5175c Mon Sep 17 00:00:00 2001
From: rgoers
Date: Sat, 6 Mar 2021 22:10:51 -0700
Subject: [PATCH 15/86] [maven-release-plugin] prepare release log4j-2.14.1-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index ee7405b..07fbd04 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.14.1-SNAPSHOT
+ 2.14.1
../
4.0.0
From 7079d44a349bc7a0d14106bd2170de928455f89f Mon Sep 17 00:00:00 2001
From: rgoers
Date: Sat, 6 Mar 2021 22:11:01 -0700
Subject: [PATCH 16/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 07fbd04..3468788 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.14.1
+ 2.15.0-SNAPSHOT
../
4.0.0
From e756493a6f2058e0cdd6d2db5ccb5d142b123085 Mon Sep 17 00:00:00 2001
From: Carter Kozak
Date: Tue, 16 Mar 2021 15:21:21 -0400
Subject: [PATCH 17/86] LOG4J2-2940: Context selectors are aware of ClassLoader
dependency
This allows LoggerContext lookups to avoid searching for the calling
class to discover a classloader when the ContextSelector implementation
is declared to be agnostic to the class loader.
Custom LoggerContextFactory and ContextSelector implementations
should be updated to override the new `isClassLoaderDependent` method.
---
.../apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
index 3db9b52..d6df19e 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
@@ -20,6 +20,7 @@
import java.lang.System.Logger;
import java.lang.System.LoggerFinder;
+import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.spi.AbstractLoggerAdapter;
import org.apache.logging.log4j.spi.LoggerContext;
import org.apache.logging.log4j.util.StackLocatorUtil;
@@ -38,6 +39,8 @@ protected Logger newLogger(String name, LoggerContext context) {
@Override
protected LoggerContext getContext() {
- return getContext(StackLocatorUtil.getCallerClass(LoggerFinder.class));
+ return getContext(LogManager.getFactory().isClassLoaderDependent()
+ ? StackLocatorUtil.getCallerClass(LoggerFinder.class)
+ : null);
}
}
From 94dbcf67c026561342d78620d9240b53a4b2cbe9 Mon Sep 17 00:00:00 2001
From: Volkan Yazici
Date: Sun, 24 Oct 2021 21:32:47 +0200
Subject: [PATCH 18/86] Upgrade from hamcrest-all:1.3 to hamcrest:2.2.
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 3468788..a802762 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -53,7 +53,7 @@
org.hamcrest
- hamcrest-all
+ hamcrest
test
From 9755205d717896f3a04fe8cbea76f14459eb08ab Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Mon, 6 Dec 2021 15:58:46 -0700
Subject: [PATCH 19/86] [maven-release-plugin] prepare release log4j-2.15.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index a802762..fd55797 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.15.0-SNAPSHOT
+ 2.15.0
../
4.0.0
From 6e04e5f0dd5c59a3b82e9b7b89540755ce432001 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Mon, 6 Dec 2021 16:13:26 -0700
Subject: [PATCH 20/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index fd55797..33f4d50 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.15.0
+ 2.15.1-SNAPSHOT
../
4.0.0
From e3e1b7aa0f44f0cd93b80395190efee753c392e0 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Thu, 9 Dec 2021 11:24:32 -0700
Subject: [PATCH 21/86] [maven-release-plugin] prepare release log4j-2.15.0-rc2
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 33f4d50..fd55797 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.15.1-SNAPSHOT
+ 2.15.0
../
4.0.0
From f591a5062e680317c3e51b3ef54f875a80f76a49 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Thu, 9 Dec 2021 11:24:40 -0700
Subject: [PATCH 22/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index fd55797..33f4d50 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.15.0
+ 2.15.1-SNAPSHOT
../
4.0.0
From 4cd88a3c50ad42e0f26562151dc610a94545d30b Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sat, 11 Dec 2021 20:41:38 -0600
Subject: [PATCH 23/86] Update maven-toolchains-plugin to 3.0.0
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 33f4d50..2588c7f 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -96,7 +96,7 @@
org.apache.maven.plugins
maven-toolchains-plugin
- 1.1
+ 3.0.0
From 6674333635598e54500b25825337179ac673dd7a Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sat, 11 Dec 2021 20:56:33 -0600
Subject: [PATCH 24/86] [maven-release-plugin] prepare release log4j-2.15.1-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 2588c7f..e4df87f 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.15.1-SNAPSHOT
+ 2.15.1
../
4.0.0
From dfa31dd0fe256e304faeed197d167a6f205b0933 Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sat, 11 Dec 2021 20:57:21 -0600
Subject: [PATCH 25/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index e4df87f..f3150cc 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.15.1
+ 2.16.0-SNAPSHOT
../
4.0.0
From fa03889c55a2d4d34de4b6294df63eaefce5841c Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sun, 12 Dec 2021 23:40:13 -0600
Subject: [PATCH 26/86] [maven-release-plugin] prepare release log4j-2.16.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f3150cc..f973e25 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.16.0-SNAPSHOT
+ 2.16.0
../
4.0.0
From 696cb4a05b7ca81ed5abfd35131f3c9f1766efab Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Sun, 12 Dec 2021 23:40:21 -0600
Subject: [PATCH 27/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f973e25..25b5155 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.16.0
+ 2.17.0-SNAPSHOT
../
4.0.0
From d17029d76972c90e01e6c954cd79e7a2217da85b Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Dec 2021 18:56:20 -0700
Subject: [PATCH 28/86] [maven-release-plugin] prepare release log4j-2.17.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 25b5155..408c12c 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.0-SNAPSHOT
+ 2.17.0
../
4.0.0
From 3033911e86bae3339529d46cd66dc8787ee0d197 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Dec 2021 18:56:28 -0700
Subject: [PATCH 29/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 408c12c..ada1ac5 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.0
+ 2.17.1-SNAPSHOT
../
4.0.0
From a2c09bdd0e56ea0d186d2d032bf0f20655d38669 Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Mon, 27 Dec 2021 17:29:31 -0600
Subject: [PATCH 30/86] [maven-release-plugin] prepare release log4j-2.17.1-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index ada1ac5..08cff01 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.1-SNAPSHOT
+ 2.17.1
../
4.0.0
From 2f36d011f0363090375c85d4d01f23886ef2e7bb Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Mon, 27 Dec 2021 17:29:39 -0600
Subject: [PATCH 31/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 08cff01..c6a5a6a 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.1
+ 2.17.2-SNAPSHOT
../
4.0.0
From f8c2063d326f312cb4bc7b20626571cef8429ea8 Mon Sep 17 00:00:00 2001
From: Carter Kozak
Date: Mon, 17 Jan 2022 20:38:05 -0500
Subject: [PATCH 32/86] LOG4J2-3345: log4j-jpl formats messages correctly using
MessageFormat (#713)
---
.../logging/log4j/jpl/Log4jSystemLogger.java | 19 +++++++++---
.../log4j/jpl/Log4jSystemLoggerTest.java | 29 +++++++++++++++++++
2 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
index 925ca71..796d6ac 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
@@ -23,6 +23,9 @@
import java.util.ResourceBundle;
import java.util.function.Supplier;
+import org.apache.logging.log4j.message.Message;
+import org.apache.logging.log4j.message.MessageFormatMessage;
+import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.spi.ExtendedLogger;
/**
@@ -53,14 +56,14 @@ public boolean isLoggable(final Level level) {
@Override
public void log(Level level, String msg) {
- log(level, (ResourceBundle) null, msg, (Object[]) null);
+ log(level, (ResourceBundle) null, msg, (Throwable) null);
}
@Override
public void log(Level level, Supplier msgSupplier) {
Objects.requireNonNull(msgSupplier);
if (isLoggable(Objects.requireNonNull(level))) {
- log(level, (ResourceBundle) null, msgSupplier.get(), (Object[]) null);
+ log(level, (ResourceBundle) null, msgSupplier.get(), (Throwable) null);
}
}
@@ -68,7 +71,7 @@ public void log(Level level, Supplier msgSupplier) {
public void log(Level level, Object obj) {
Objects.requireNonNull(obj);
if (isLoggable(Objects.requireNonNull(level))) {
- log(level, (ResourceBundle) null, obj.toString(), (Object[]) null);
+ log(level, (ResourceBundle) null, obj.toString(), (Throwable) null);
}
}
@@ -97,7 +100,15 @@ public void log(final Level level, final ResourceBundle bundle, final String msg
@Override
public void log(final Level level, final ResourceBundle bundle, final String format, final Object... params) {
- logger.logIfEnabled(FQCN, getLevel(level), null, getResource(bundle, format), params);
+ Message message = createMessage(getResource(bundle, format), params);
+ logger.logIfEnabled(FQCN, getLevel(level), null, message, message.getThrowable());
+ }
+
+ private static Message createMessage(final String format, final Object... params) {
+ if (params == null || params.length == 0) {
+ return new SimpleMessage(format);
+ }
+ return new MessageFormatMessage(format, params);
}
private static org.apache.logging.log4j.Level getLevel(final Level level) {
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
index ccc4b3c..b4eeb2b 100644
--- a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -22,6 +22,7 @@
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertThat;
import java.lang.System.Logger;
@@ -85,6 +86,34 @@ public void testLog() throws Exception {
assertEquals(Log4jSystemLogger.class.getName(), event.getLoggerFqcn());
}
+ @Test
+ public void testParameterizedLogging() {
+ logger.log(Logger.Level.INFO, "Hello, {0}!", "World");
+ final List events = eventAppender.getEvents();
+ assertThat(events, hasSize(1));
+ final LogEvent event = events.get(0);
+ assertThat(event, instanceOf(Log4jLogEvent.class));
+ assertEquals(Level.INFO, event.getLevel());
+ assertEquals(LOGGER_NAME, event.getLoggerName());
+ assertEquals("Hello, World!", event.getMessage().getFormattedMessage());
+ assertEquals(Log4jSystemLogger.class.getName(), event.getLoggerFqcn());
+ }
+
+ @Test
+ public void testParameterizedLoggingWithThrowable() {
+ Throwable throwable = new RuntimeException();
+ logger.log(Logger.Level.INFO, "Hello, {0}!", "World", throwable);
+ final List events = eventAppender.getEvents();
+ assertThat(events, hasSize(1));
+ final LogEvent event = events.get(0);
+ assertThat(event, instanceOf(Log4jLogEvent.class));
+ assertEquals(Level.INFO, event.getLevel());
+ assertEquals(LOGGER_NAME, event.getLoggerName());
+ assertEquals("Hello, World!", event.getMessage().getFormattedMessage());
+ assertEquals(Log4jSystemLogger.class.getName(), event.getLoggerFqcn());
+ assertSame(throwable, event.getThrown());
+ }
+
@Test
public void testLogWithCallingClass() throws Exception {
final Logger log = System.getLogger("Test.CallerClass");
From 74736ec34c8d932084e2730668c2f95d6d6d0fb6 Mon Sep 17 00:00:00 2001
From: Matt Sicker
Date: Fri, 21 Jan 2022 21:39:48 -0600
Subject: [PATCH 33/86] Clean up pom.xml files
- Remove invalid values
- Disable doap and changes plugins in child modules
- Use correct Fragment-Host in bundles implementing log4j-core plugins
- Add OSGi service loader metadata for more bundles
---
log4j-jpl/pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index c6a5a6a..5e8f6cf 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -21,7 +21,6 @@
log4j
org.apache.logging.log4j
2.17.2-SNAPSHOT
- ../
4.0.0
From 170de479e76d2c725f1c5aac77c9e4967b9bdc17 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Wed, 23 Feb 2022 13:27:21 -0700
Subject: [PATCH 34/86] [maven-release-plugin] prepare release log4j-2.17.2-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 5e8f6cf..3c28c8b 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.2-SNAPSHOT
+ 2.17.2
4.0.0
From f7a7def207a9dd0a2de4873196e353a15ad16648 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Wed, 23 Feb 2022 13:27:33 -0700
Subject: [PATCH 35/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 3c28c8b..261019c 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.2
+ 2.17.3-SNAPSHOT
4.0.0
From d9c18677fd8fa10bce7fce28065ac2e1d427641f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 28 May 2022 02:47:39 +0000
Subject: [PATCH 36/86] Bump surefire.plugin.version from 3.0.0-M5 to 3.0.0-M6
Bumps `surefire.plugin.version` from 3.0.0-M5 to 3.0.0-M6.
Updates `maven-surefire-plugin` from 3.0.0-M5 to 3.0.0-M6
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M5...surefire-3.0.0-M6)
Updates `maven-surefire-report-plugin` from 3.0.0-M5 to 3.0.0-M6
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M5...surefire-3.0.0-M6)
---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
dependency-type: direct:production
update-type: version-update:semver-patch
- dependency-name: org.apache.maven.plugins:maven-surefire-report-plugin
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 261019c..8ba278e 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -143,7 +143,7 @@
org.apache.maven.plugins
maven-surefire-plugin
- 2.13
+ 3.0.0-M6
From 33896f2633773d4d94a4f5ee7a16405f77664bee Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sat, 28 May 2022 21:21:19 +0200
Subject: [PATCH 37/86] Keep `log4j-jpl` at Surefire version 2.13
---
log4j-jpl/pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 8ba278e..1db9097 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -142,8 +142,8 @@
org.apache.maven.plugins
maven-surefire-plugin
-
- 3.0.0-M6
+
+ 2.13
From 1ac09a89a536b568020cef257ac8c96e4a38f2d0 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Tue, 28 Jun 2022 15:02:52 -0700
Subject: [PATCH 38/86] [maven-release-plugin] prepare release log4j-2.18.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 1db9097..5d58d16 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.17.3-SNAPSHOT
+ 2.18.0
4.0.0
From 934b8ad7fb7010d6b7e9dd27821060982db2b0a6 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Tue, 28 Jun 2022 15:03:03 -0700
Subject: [PATCH 39/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 5d58d16..5a49b65 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.18.0
+ 2.18.1-SNAPSHOT
4.0.0
From 254662bb9c585c6956085b81a5450e5a53734330 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Tue, 6 Sep 2022 14:37:30 +0200
Subject: [PATCH 40/86] Use `junit-bom`
This replaces independent JUnit5 dependency versioning with a single
`junit-bom` dependency.
---
log4j-jpl/pom.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 5a49b65..5dea55c 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -58,10 +58,12 @@
org.junit.vintage
junit-vintage-engine
+ test
org.junit.jupiter
junit-jupiter-engine
+ test
From bbf5a6ac658664b2926f8647b1f6b0698513d73e Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 9 Sep 2022 00:18:17 -0700
Subject: [PATCH 41/86] [maven-release-plugin] prepare release log4j-2.19.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 5dea55c..afb6ec5 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.18.1-SNAPSHOT
+ 2.19.0
4.0.0
From 8b3ac016c31eb348ae9c4742b81a458c4e8ec5fa Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 9 Sep 2022 00:18:29 -0700
Subject: [PATCH 42/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index afb6ec5..c22949a 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.19.0
+ 2.19.1-SNAPSHOT
4.0.0
From ee4a25f036eb7e53b4af419fa9b95fb646bae5db Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 9 Sep 2022 12:24:00 -0700
Subject: [PATCH 43/86] [maven-release-plugin] prepare release log4j-2.19.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index c22949a..afb6ec5 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.19.1-SNAPSHOT
+ 2.19.0
4.0.0
From 02ddf84053af774a66cbcca51703d4347e93f962 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 9 Sep 2022 12:24:11 -0700
Subject: [PATCH 44/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index afb6ec5..c22949a 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.19.0
+ 2.19.1-SNAPSHOT
4.0.0
From 019040108093539b99a9b0ff1616780cf536c1e9 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Tue, 13 Sep 2022 10:15:41 -0700
Subject: [PATCH 45/86] [maven-release-plugin] prepare release log4j-2.19.0-rc2
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index c22949a..afb6ec5 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.19.1-SNAPSHOT
+ 2.19.0
4.0.0
From bcd089986361f2c169f7ed9558e3529b4c0eb8ce Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Tue, 13 Sep 2022 10:15:54 -0700
Subject: [PATCH 46/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index afb6ec5..295cb30 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.19.0
+ 2.29.1-SNAPSHOT
4.0.0
From da160e74b351d873263e845d29af6575c3cf75b8 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sat, 17 Sep 2022 00:53:47 +0200
Subject: [PATCH 47/86] Fix new snapshot version
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 295cb30..c22949a 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
log4j
org.apache.logging.log4j
- 2.29.1-SNAPSHOT
+ 2.19.1-SNAPSHOT
4.0.0
From 1a269816c4cab570768eb7a3bd61ab37f482bb3a Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sun, 18 Sep 2022 20:24:48 +0200
Subject: [PATCH 48/86] Sort dependencies in POMs
Improves the `src/tools/sort-pom.xslt` stylesheet to sort dependencies in the
POM files according to the scope, artifact id (with a priority for Logj2
artifacts) and group id.
It uses this script to automatically sort all POM files.
---
log4j-jpl/pom.xml | 85 +++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 43 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index c22949a..2982b87 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -15,7 +15,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-
log4j
@@ -56,34 +55,19 @@
test
- org.junit.vintage
- junit-vintage-engine
+ org.junit.jupiter
+ junit-jupiter-engine
test
- org.junit.jupiter
- junit-jupiter-engine
+ org.junit.vintage
+ junit-vintage-engine
test
-
-
- org.apache.maven.plugins
- maven-remote-resources-plugin
-
-
-
- process
-
-
- false
-
-
-
-
org.apache.felix
maven-bundle-plugin
@@ -94,25 +78,6 @@
-
- org.apache.maven.plugins
- maven-toolchains-plugin
- 3.0.0
-
-
-
- toolchain
-
-
-
-
-
-
- [11, )
-
-
-
-
org.apache.maven.plugins
maven-compiler-plugin
@@ -141,13 +106,28 @@
javac
+
+
+ org.apache.maven.plugins
+ maven-remote-resources-plugin
+
+
+
+ process
+
+
+ false
+
+
+
+
org.apache.maven.plugins
maven-surefire-plugin
2.13
-
+
@@ -159,6 +139,25 @@
+
+ org.apache.maven.plugins
+ maven-toolchains-plugin
+ 3.0.0
+
+
+
+ toolchain
+
+
+
+
+
+
+ [11, )
+
+
+
+
@@ -197,9 +196,9 @@
maven-javadoc-plugin
${javadoc.plugin.version}
- Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.
+ <p align="center">Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.<br />
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
- and the Apache Log4j logo are trademarks of The Apache Software Foundation.]]>
+ and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p>
false
@@ -250,7 +249,7 @@
${surefire.plugin.version}
-
+
test
From 04a995dd06115d224b94167c85e81697309a1141 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sun, 25 Sep 2022 23:58:23 +0200
Subject: [PATCH 49/86] Move additional `log4j-core-test` classes to `main`
---
log4j-jpl/pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 2982b87..8a32199 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -45,8 +45,7 @@
org.apache.logging.log4j
- log4j-core
- test-jar
+ log4j-core-test
test
From eb8de4858a7466ae7eb546f9df56f336862c119c Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Mon, 26 Sep 2022 00:13:58 +0200
Subject: [PATCH 50/86] Move exported test classes under
`org.apache.logging.log4j.core.test`
---
.../org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
index b4eeb2b..1757590 100644
--- a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -31,7 +31,7 @@
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
-import org.apache.logging.log4j.test.appender.ListAppender;
+import org.apache.logging.log4j.core.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
From 9b0d09cf0574614cb25af943ef16afb5dd7eadcd Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sun, 18 Sep 2022 10:53:36 +0200
Subject: [PATCH 51/86] Delegates plugin versions to ASF parent
This PR removes all explicitly versioned plugins that are also defined in the
Apache ASF parent POM (`org.apache:apache`).
This has the following effect on plugin versions:
* `maven-assembly-plugin` bumped to 3.4.1
* `maven-jar-plugin` bumped to 3.2.2
* `maven-javadoc-plugin` bumped to 3.4.0
* `maven-project-info-reports-plugin` bumped to 3.3.0
* `maven-release-plugin` bumped to 3.0.0-M6
* `maven-scm-plugin` bumped to 1.13.0
* `maven-site-plugin` bumped to 3.12.0
---
log4j-jpl/pom.xml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 8a32199..964a72f 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -193,7 +193,6 @@
org.apache.maven.plugins
maven-javadoc-plugin
- ${javadoc.plugin.version}
<p align="center">Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.<br />
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
@@ -245,8 +244,6 @@
org.apache.maven.plugins
maven-surefire-plugin
-
- ${surefire.plugin.version}
From 26d0d3bbaada3178ce776be62dad7619806ae566 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sun, 2 Oct 2022 08:32:58 +0200
Subject: [PATCH 52/86] Centralize plugin versions in main POM
The versions of all used plugins are specified in the `log4j` parent POM
or other parent POMs (`log4j-bom`, `log4j-samples`,
`log4j-spring-cloud-config` or `log4j-spring-cloud-config-samples`).
The script `src/tools/explicit-version.xslt` can be used to check for
explicitly provided version.
---
log4j-jpl/pom.xml | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 964a72f..f6ec5e6 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -27,6 +27,8 @@
${basedir}/..
org.apache.logging.log4j.jpl
true
+
+ 2.13
log4j-jpl
@@ -123,8 +125,6 @@
org.apache.maven.plugins
maven-surefire-plugin
-
- 2.13
@@ -141,7 +141,6 @@
org.apache.maven.plugins
maven-toolchains-plugin
- 3.0.0
@@ -164,7 +163,6 @@
org.apache.maven.plugins
maven-changes-plugin
- ${changes.plugin.version}
@@ -180,7 +178,6 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- ${checkstyle.plugin.version}
${log4jParentDir}/checkstyle.xml
${log4jParentDir}/checkstyle-suppressions.xml
@@ -215,7 +212,6 @@
org.apache.maven.plugins
maven-jxr-plugin
- ${jxr.plugin.version}
non-aggregate
@@ -264,7 +260,6 @@
org.apache.maven.plugins
maven-pmd-plugin
- ${pmd.plugin.version}
${maven.compiler.target}
From 77733aa3443138b5bbf891a3f8c616816ed1191a Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Tue, 18 Oct 2022 11:01:39 +0200
Subject: [PATCH 53/86] Remove no-op plugin execution
The 'default' maven-remote-resources-plugin execution is a no-op,
because the ASF parent uses a different id.
---
log4j-jpl/pom.xml | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f6ec5e6..4948e6b 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -107,21 +107,6 @@
javac
-
-
- org.apache.maven.plugins
- maven-remote-resources-plugin
-
-
-
- process
-
-
- false
-
-
-
-
org.apache.maven.plugins
maven-surefire-plugin
From 14fc114fc429c30edc1749e2e27c46217eaba62a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Fri, 13 Jan 2023 17:14:26 +0100
Subject: [PATCH 54/86] LOG4J2-3628 Replace `maven-changes-plugin` with
`log4j-changelog` (#1145)
---
log4j-jpl/pom.xml | 15 ---------------
log4j-jpl/src/site/site.xml | 2 --
2 files changed, 17 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 4948e6b..358ba39 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -145,21 +145,6 @@
-
- org.apache.maven.plugins
- maven-changes-plugin
-
-
-
- changes-report
-
-
-
-
- %URL%/show_bug.cgi?id=%ISSUE%
- true
-
-
org.apache.maven.plugins
maven-checkstyle-plugin
diff --git a/log4j-jpl/src/site/site.xml b/log4j-jpl/src/site/site.xml
index fccc81f..06a0705 100644
--- a/log4j-jpl/src/site/site.xml
+++ b/log4j-jpl/src/site/site.xml
@@ -43,8 +43,6 @@
From 05d05537447438a98887ef035e23ab1d99e50f3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Mon, 16 Jan 2023 19:37:49 +0100
Subject: [PATCH 55/86] Simplify site generation (#1166)
---
log4j-jpl/pom.xml | 1 -
log4j-jpl/src/site/markdown/index.md | 30 -----------------
log4j-jpl/src/site/site.xml | 50 ----------------------------
3 files changed, 81 deletions(-)
delete mode 100644 log4j-jpl/src/site/markdown/index.md
delete mode 100644 log4j-jpl/src/site/site.xml
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 358ba39..015cf0c 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -26,7 +26,6 @@
${basedir}/..
org.apache.logging.log4j.jpl
- true
2.13
diff --git a/log4j-jpl/src/site/markdown/index.md b/log4j-jpl/src/site/markdown/index.md
deleted file mode 100644
index 1e5da79..0000000
--- a/log4j-jpl/src/site/markdown/index.md
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-# Log4j 2 JDK Platform Logging Adapter
-
-The Log4j 2 JDK Logging Adapter allow to route all System.Logger events to Log4j 2 APIs.
-
-## Requirements
-
-The JDK Platform Logging Adapter is dependent on the Log4j API as well as Java 11.
-
-## Usage
-
-Simply include the Log4j 2 JDK Platform Logging Adapter jar along with the Log4j2 jars to cause all System.Logger
-logging to be handled by Log4j 2.
diff --git a/log4j-jpl/src/site/site.xml b/log4j-jpl/src/site/site.xml
deleted file mode 100644
index 06a0705..0000000
--- a/log4j-jpl/src/site/site.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From b08746c6aaacdb56045de65a008117a17beb831e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Sun, 12 Feb 2023 21:53:05 +0100
Subject: [PATCH 56/86] Fix Javadoc generation and links for the site
- Removed `maven-jxr-plugin`
- Generating no Javadoc JARs (this was already the case)
- Removed Javadoc JARs from the assembly in `log4j-distribution`
- Generating Javadoc HTML only for `log4j-core` and `log4j-api`
- Copying generated Javadoc HTML to `target/site/javadoc/`
---
log4j-jpl/pom.xml | 40 ----------------------------------------
1 file changed, 40 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 015cf0c..36ad1a5 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -156,46 +156,6 @@
**/module-info.java
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- <p align="center">Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.<br />
- Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
- and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p>
-
- false
- true
- false
-
-
-
- non-aggregate
-
- javadoc
-
-
-
-
-
- org.apache.maven.plugins
- maven-jxr-plugin
-
-
- non-aggregate
-
- jxr
-
-
-
- aggregate
-
- aggregate
-
-
-
-
From 59341257c184c7aca69bd46307a7a783cdfde428 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Tue, 14 Feb 2023 21:10:18 +0100
Subject: [PATCH 57/86] Remove Maven `` blocks, since reporting is
disabled
---
log4j-jpl/pom.xml | 28 ----------------------------
1 file changed, 28 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 36ad1a5..d26876f 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -142,22 +142,6 @@
-
-
-
- org.apache.maven.plugins
- maven-checkstyle-plugin
-
- ${log4jParentDir}/checkstyle.xml
- ${log4jParentDir}/checkstyle-suppressions.xml
- false
- basedir=${basedir}
- licensedir=${log4jParentDir}/checkstyle-header.txt
- **/module-info.java
-
-
-
-
java11-module
@@ -183,18 +167,6 @@
-
-
-
-
- org.apache.maven.plugins
- maven-pmd-plugin
-
- ${maven.compiler.target}
-
-
-
-
From 66d76d6a34a5b56a4abd1bd0233a9cbb4ab32c4a Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 18:26:33 -0700
Subject: [PATCH 58/86] [maven-release-plugin] prepare release log4j-2.20.1-rc1
---
log4j-jpl/pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index d26876f..f380932 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.19.1-SNAPSHOT
+ 2.20.0
4.0.0
@@ -110,7 +110,7 @@
org.apache.maven.plugins
maven-surefire-plugin
-
+
@@ -154,7 +154,7 @@
org.apache.maven.plugins
maven-surefire-plugin
-
+
test
From 9dad770eb97b7d2573302c26494ecbd0fefaab0e Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 18:26:37 -0700
Subject: [PATCH 59/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f380932..46cf317 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.20.0
+ 2.20.1-SNAPSHOT
4.0.0
From b5e666503ba665f341a164f997dd21602a8a7856 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 21:40:16 -0700
Subject: [PATCH 60/86] [maven-release-plugin] prepare release log4j-2.20.1-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 46cf317..f380932 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.20.1-SNAPSHOT
+ 2.20.0
4.0.0
From 0fda3a0ce0cf1c013c5cbf3d66b590fa747e35a9 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 21:48:49 -0700
Subject: [PATCH 61/86] Revert version update
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f380932..3ad4386 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.20.0
+ 2.19.1-SNAPSHOT
4.0.0
From 9344b43043ac4d000eb85eedaa61913548614bbf Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 21:54:33 -0700
Subject: [PATCH 62/86] [maven-release-plugin] prepare release log4j-2.20.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 3ad4386..f380932 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.19.1-SNAPSHOT
+ 2.20.0
4.0.0
From e547426cfc6802b477dab5e09d8f6d2b6cb98624 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 21:54:36 -0700
Subject: [PATCH 63/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f380932..46cf317 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.20.0
+ 2.20.1-SNAPSHOT
4.0.0
From 458a99217013abeba048fe53c9b431fd34335876 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 22:00:23 -0700
Subject: [PATCH 64/86] [maven-release-plugin] rollback the release of
log4j-2.20.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 46cf317..3ad4386 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.20.1-SNAPSHOT
+ 2.19.1-SNAPSHOT
4.0.0
From a4b5b7b47da5ce2b39eefada2cebd43d5eb3f8a8 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 22:19:34 -0700
Subject: [PATCH 65/86] [maven-release-plugin] prepare release log4j-2.20.0-rc1
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 3ad4386..f380932 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.19.1-SNAPSHOT
+ 2.20.0
4.0.0
From 069a8127c9109b391000960a712d5755207eb284 Mon Sep 17 00:00:00 2001
From: Ralph Goers
Date: Fri, 17 Feb 2023 22:19:38 -0700
Subject: [PATCH 66/86] [maven-release-plugin] prepare for next development
iteration
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index f380932..46cf317 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -19,7 +19,7 @@
log4j
org.apache.logging.log4j
- 2.20.0
+ 2.20.1-SNAPSHOT
4.0.0
From bc7bca8370bc94b1192d3a1e5359337461305547 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sat, 4 Mar 2023 15:35:24 +0100
Subject: [PATCH 67/86] Sort POMs
---
log4j-jpl/pom.xml | 54 +++++++++++++++++++++++------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 46cf317..2c06041 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -16,12 +16,16 @@
~ limitations under the License.
-->
+ 4.0.0
- log4j
org.apache.logging.log4j
+ log4j
2.20.1-SNAPSHOT
- 4.0.0
+
+ log4j-jpl
+ Apache Log4j JDK Platform Logging Adapter
+ The Apache Log4j implementation of java.lang.System.LoggerFinder
${basedir}/..
@@ -30,10 +34,6 @@
2.13
- log4j-jpl
- Apache Log4j JDK Platform Logging Adapter
- The Apache Log4j implementation of java.lang.System.LoggerFinder
-
org.apache.logging.log4j
@@ -81,57 +81,50 @@
org.apache.maven.plugins
maven-compiler-plugin
+
+ 11
+ 11
+ 11
+ none
+
+ javac
+
default-compile
- compile
compile
+ compile
default-testCompile
- test-compile
testCompile
+ test-compile
-
- 11
- 11
- 11
- none
-
- javac
-
org.apache.maven.plugins
maven-surefire-plugin
-
+
test
- test
test
+ test
org.apache.maven.plugins
maven-toolchains-plugin
-
-
-
- toolchain
-
-
-
@@ -139,6 +132,13 @@
+
+
+
+ toolchain
+
+
+
@@ -154,14 +154,14 @@
org.apache.maven.plugins
maven-surefire-plugin
-
+
test
- test
test
+ test
From 579b240bdbdf98baefa2547b959c8610505aedf2 Mon Sep 17 00:00:00 2001
From: "spotless[bot]"
Date: Tue, 25 Apr 2023 18:32:35 +0200
Subject: [PATCH 68/86] Apply Spotless to all files
---
log4j-jpl/pom.xml | 10 +++----
.../logging/log4j/jpl/Log4jSystemLogger.java | 11 ++++----
.../log4j/jpl/Log4jSystemLoggerAdapter.java | 11 ++++----
.../log4j/jpl/Log4jSystemLoggerFinder.java | 11 ++++----
.../log4j/jpl/Log4jSystemLoggerTest.java | 27 +++++++++----------
log4j-jpl/src/test/resources/log4j2-test.xml | 8 +++---
6 files changed, 37 insertions(+), 41 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 2c06041..4f9862e 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -1,11 +1,11 @@
-
+
test
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
index 796d6ac..b512fee 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
@@ -1,20 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.logging.log4j.jpl;
import java.lang.System.Logger;
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
index d6df19e..c1f5597 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
@@ -1,20 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.logging.log4j.jpl;
import java.lang.System.Logger;
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
index cb8670d..536f614 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
@@ -1,20 +1,19 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.logging.log4j.jpl;
import java.lang.System.Logger;
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
index 1757590..14fa926 100644
--- a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -1,30 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
+ * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
+ * The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
-
package org.apache.logging.log4j.jpl;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-
import java.lang.System.Logger;
import java.util.List;
@@ -36,6 +27,14 @@
import org.junit.Before;
import org.junit.Test;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+
public class Log4jSystemLoggerTest {
public static final String LOGGER_NAME = "Test";
diff --git a/log4j-jpl/src/test/resources/log4j2-test.xml b/log4j-jpl/src/test/resources/log4j2-test.xml
index 27cef64..79c22e7 100644
--- a/log4j-jpl/src/test/resources/log4j2-test.xml
+++ b/log4j-jpl/src/test/resources/log4j2-test.xml
@@ -1,10 +1,11 @@
+
-
From 2b4735147b699b51411ea77fda9d7920c72e0e97 Mon Sep 17 00:00:00 2001
From: OpenRewrite
Date: Sun, 4 Jun 2023 13:58:36 +0200
Subject: [PATCH 69/86] Use `final` whenever possible
---
.../logging/log4j/jpl/Log4jSystemLogger.java | 16 ++++++++--------
.../log4j/jpl/Log4jSystemLoggerAdapter.java | 2 +-
.../log4j/jpl/Log4jSystemLoggerFinder.java | 2 +-
.../logging/log4j/jpl/Log4jSystemLoggerTest.java | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
index b512fee..1f35951 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
@@ -54,12 +54,12 @@ public boolean isLoggable(final Level level) {
}
@Override
- public void log(Level level, String msg) {
+ public void log(final Level level, final String msg) {
log(level, (ResourceBundle) null, msg, (Throwable) null);
}
@Override
- public void log(Level level, Supplier msgSupplier) {
+ public void log(final Level level, final Supplier msgSupplier) {
Objects.requireNonNull(msgSupplier);
if (isLoggable(Objects.requireNonNull(level))) {
log(level, (ResourceBundle) null, msgSupplier.get(), (Throwable) null);
@@ -67,7 +67,7 @@ public void log(Level level, Supplier msgSupplier) {
}
@Override
- public void log(Level level, Object obj) {
+ public void log(final Level level, final Object obj) {
Objects.requireNonNull(obj);
if (isLoggable(Objects.requireNonNull(level))) {
log(level, (ResourceBundle) null, obj.toString(), (Throwable) null);
@@ -75,12 +75,12 @@ public void log(Level level, Object obj) {
}
@Override
- public void log(Level level, String msg, Throwable thrown) {
+ public void log(final Level level, final String msg, final Throwable thrown) {
log(level, null, msg, thrown);
}
@Override
- public void log(Level level, Supplier msgSupplier, Throwable thrown) {
+ public void log(final Level level, final Supplier msgSupplier, final Throwable thrown) {
Objects.requireNonNull(msgSupplier);
if (isLoggable(Objects.requireNonNull(level))) {
log(level, null, msgSupplier.get(), thrown);
@@ -88,7 +88,7 @@ public void log(Level level, Supplier msgSupplier, Throwable thrown) {
}
@Override
- public void log(Level level, String format, Object... params) {
+ public void log(final Level level, final String format, final Object... params) {
log(level, null, format, params);
}
@@ -99,7 +99,7 @@ public void log(final Level level, final ResourceBundle bundle, final String msg
@Override
public void log(final Level level, final ResourceBundle bundle, final String format, final Object... params) {
- Message message = createMessage(getResource(bundle, format), params);
+ final Message message = createMessage(getResource(bundle, format), params);
logger.logIfEnabled(FQCN, getLevel(level), null, message, message.getThrowable());
}
@@ -130,7 +130,7 @@ private static org.apache.logging.log4j.Level getLevel(final Level level) {
return org.apache.logging.log4j.Level.ERROR;
}
- private static String getResource(ResourceBundle bundle, String msg) {
+ private static String getResource(final ResourceBundle bundle, final String msg) {
if (bundle == null || msg == null) {
return msg;
}
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
index c1f5597..b3d35b6 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
@@ -32,7 +32,7 @@
public class Log4jSystemLoggerAdapter extends AbstractLoggerAdapter {
@Override
- protected Logger newLogger(String name, LoggerContext context) {
+ protected Logger newLogger(final String name, final LoggerContext context) {
return new Log4jSystemLogger(context.getLogger(name));
}
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
index 536f614..0d349d1 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
@@ -26,7 +26,7 @@ public class Log4jSystemLoggerFinder extends System.LoggerFinder {
private final Log4jSystemLoggerAdapter loggerAdapter = new Log4jSystemLoggerAdapter();
@Override
- public Logger getLogger(String name, Module module) {
+ public Logger getLogger(final String name, final Module module) {
return loggerAdapter.getLogger(name);
}
}
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
index 14fa926..1b0da33 100644
--- a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -100,7 +100,7 @@ public void testParameterizedLogging() {
@Test
public void testParameterizedLoggingWithThrowable() {
- Throwable throwable = new RuntimeException();
+ final Throwable throwable = new RuntimeException();
logger.log(Logger.Level.INFO, "Hello, {0}!", "World", throwable);
final List events = eventAppender.getEvents();
assertThat(events, hasSize(1));
From cdb921465d3c604772659699c9087893ddb6fd70 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Mon, 27 Feb 2023 16:35:37 +0100
Subject: [PATCH 70/86] Switch build to JDK 11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Volkan Yazıcı
---
log4j-jpl/pom.xml | 90 ++++++-----------------------------------------
1 file changed, 11 insertions(+), 79 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 4f9862e..0f4974d 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -30,8 +30,7 @@
${basedir}/..
org.apache.logging.log4j.jpl
-
- 2.13
+ 11
@@ -68,6 +67,7 @@
+
org.apache.felix
maven-bundle-plugin
@@ -78,92 +78,24 @@
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- 11
- 11
- 11
- none
-
- javac
-
-
-
- default-compile
-
- compile
-
- compile
-
-
- default-testCompile
-
- testCompile
-
- test-compile
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
-
-
- test
-
- test
-
- test
-
-
-
-
- org.apache.maven.plugins
- maven-toolchains-plugin
-
-
-
- [11, )
-
-
-
-
-
-
- toolchain
-
-
-
-
+
+
- java11-module
-
- [11,)
-
+ java8-tests
org.apache.maven.plugins
maven-surefire-plugin
-
-
-
-
- test
-
- test
-
- test
-
-
+
+ false
+
+ true
+
+
From 2bac18a9fd855af15032142a13ca41e7e5ec8e12 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Wed, 20 Sep 2023 09:04:34 +0200
Subject: [PATCH 71/86] Bump version to 2.21.0-SNAPSHOT
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 0f4974d..6b61b84 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
org.apache.logging.log4j
log4j
- 2.20.1-SNAPSHOT
+ 2.21.0-SNAPSHOT
log4j-jpl
From 0ba29a7ac9010233186559a76d4ba255bfd5c55e Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Mon, 25 Sep 2023 10:57:24 +0200
Subject: [PATCH 72/86] Remove references to `maven-bundle-plugin`
---
log4j-jpl/pom.xml | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 6b61b84..bf857aa 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -65,23 +65,6 @@
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
-
-
- org.apache.logging.log4j.core
- org.apache.logging.log4j.jpl
-
-
-
-
-
-
-
java8-tests
From c9d8326d97c5d552f419fae7d2a253a62e297d36 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Tue, 26 Sep 2023 09:03:51 +0200
Subject: [PATCH 73/86] Replace explicit versions with property
---
log4j-jpl/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index bf857aa..cbad363 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -20,7 +20,7 @@
org.apache.logging.log4j
log4j
- 2.21.0-SNAPSHOT
+ ${revision}
log4j-jpl
From cb817504dd4d4113a8db32448c371cf4d33637da Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Fri, 29 Sep 2023 12:26:29 +0200
Subject: [PATCH 74/86] Add BND configuration to bridges
---
.../log4j/jpl/Log4jSystemLoggerFinder.java | 4 ++++
.../logging/log4j/jpl/package-info.java | 20 +++++++++++++++++++
2 files changed, 24 insertions(+)
create mode 100644 log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
index 0d349d1..cb9d41b 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
@@ -18,9 +18,13 @@
import java.lang.System.Logger;
+import aQute.bnd.annotation.Resolution;
+import aQute.bnd.annotation.spi.ServiceProvider;
+
/**
* @since 2.14
*/
+@ServiceProvider(value = System.LoggerFinder.class, resolution = Resolution.OPTIONAL)
public class Log4jSystemLoggerFinder extends System.LoggerFinder {
private final Log4jSystemLoggerAdapter loggerAdapter = new Log4jSystemLoggerAdapter();
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
new file mode 100644
index 0000000..62bd31f
--- /dev/null
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+@Export
+package org.apache.logging.log4j.jpl;
+
+import org.osgi.annotation.bundle.Export;
From d6a94fd785225d9b507dad5509a90706e86ca5ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Thu, 5 Oct 2023 09:51:52 +0200
Subject: [PATCH 75/86] Migrate changelog, site, and docs to the new infra
---
log4j-jpl/pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index cbad363..fefae3a 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -28,7 +28,6 @@
The Apache Log4j implementation of java.lang.System.LoggerFinder
- ${basedir}/..
org.apache.logging.log4j.jpl
11
From bcd3023a043e76ebaf972434ce9e5afb92e4ce5d Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Wed, 4 Oct 2023 13:44:37 +0200
Subject: [PATCH 76/86] Automatically enable Java 8 tests on the CI
Instead of providing a parameter to `mvnw`, we always activate Java 8
tests on the CI.
---
log4j-jpl/pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index fefae3a..4ff4706 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -67,6 +67,12 @@
java8-tests
+
+
+ env.CI
+ true
+
+
From 59eee053b65b016594b2f8b0562668f78ed8be0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Thu, 5 Oct 2023 12:45:34 +0200
Subject: [PATCH 77/86] Swap `/pom.xml` and `/log4j-bom/pom.xml`
- `/pom.xml` is moved to `/log4j-parent/pom.xml`
- `/log4j-bom/pom.xml` is moved to `/pom.xml`
- Implements the BOM organization described by Maven[1].
That is, `parent` inherits from `bom`.
- Takes advantage of `flatten-bom` provided by `logging-parent`
- Identical scheme to the one found in `-tools` and `-transformation`
[1] https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms
---
log4j-jpl/pom.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 4ff4706..b232754 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -21,6 +21,7 @@
org.apache.logging.log4j
log4j
${revision}
+ ../log4j-parent
log4j-jpl
From 5bd6a0a86be22a7b5e84c4a0b4e0400037f50f3d Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Fri, 6 Oct 2023 11:58:53 +0200
Subject: [PATCH 78/86] Remove `log4j-core` from some processor paths
There are many modules that do not depend on `log4j-core` and they can
be easily built without it on the processor path.
---
log4j-jpl/pom.xml | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index b232754..81f86bb 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -65,6 +65,25 @@
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+
+
+ com.google.errorprone
+ error_prone_core
+ ${error-prone.version}
+
+
+
+
+
+
+
java8-tests
From ba051b7dbbeed28ca74a861e973615c8eb94c86e Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Fri, 6 Oct 2023 12:52:17 +0200
Subject: [PATCH 79/86] Add `log4j-core` to some modules processor path
Since the split between modules that have Log4j Core plugins and those
that don't is about 50/50, it is more proper to add `log4j-core` to some
modules instead of removing it from others (and copy/paste all other
options).
---
log4j-jpl/pom.xml | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 81f86bb..b232754 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -65,25 +65,6 @@
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
-
-
- com.google.errorprone
- error_prone_core
- ${error-prone.version}
-
-
-
-
-
-
-
java8-tests
From 3abb1f3b0ee1269755b16172c2daf2a8ec9c5238 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Sun, 8 Oct 2023 07:31:46 +0200
Subject: [PATCH 80/86] Add OSGi package versioning and fix API breaking
changes
In order to prevent API breaking changes, this:
* adds [`bnd-baseline-maven-plugin`](https://github.com/bndtools/bnd/tree/master/maven-plugins/bnd-baseline-maven-plugin),
* fix the API changes that would require a major version bump,
* set the OSGi version of each packages to `2.20.1` or `2.21.0`,
depending on the kind of changes the package underwent since the
`2.20.0` release.
---
.../main/java/org/apache/logging/log4j/jpl/package-info.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
index 62bd31f..f2db704 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
@@ -15,6 +15,8 @@
* limitations under the license.
*/
@Export
+@Version("2.20.1")
package org.apache.logging.log4j.jpl;
import org.osgi.annotation.bundle.Export;
+import org.osgi.annotation.versioning.Version;
From 2cd7fdcc9bc0b34a991eefe368466491774b48e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volkan=20Yaz=C4=B1c=C4=B1?=
Date: Thu, 16 Nov 2023 11:22:14 +0100
Subject: [PATCH 81/86] Apply Palantir formatter
---
.../logging/log4j/jpl/Log4jSystemLogger.java | 1 -
.../log4j/jpl/Log4jSystemLoggerAdapter.java | 8 ++++----
.../log4j/jpl/Log4jSystemLoggerFinder.java | 3 +--
.../log4j/jpl/Log4jSystemLoggerTest.java | 17 ++++++++---------
4 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
index 1f35951..cc384bd 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
@@ -21,7 +21,6 @@
import java.util.Objects;
import java.util.ResourceBundle;
import java.util.function.Supplier;
-
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.MessageFormatMessage;
import org.apache.logging.log4j.message.SimpleMessage;
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
index b3d35b6..ec41841 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
@@ -18,7 +18,6 @@
import java.lang.System.Logger;
import java.lang.System.LoggerFinder;
-
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.spi.AbstractLoggerAdapter;
import org.apache.logging.log4j.spi.LoggerContext;
@@ -38,8 +37,9 @@ protected Logger newLogger(final String name, final LoggerContext context) {
@Override
protected LoggerContext getContext() {
- return getContext(LogManager.getFactory().isClassLoaderDependent()
- ? StackLocatorUtil.getCallerClass(LoggerFinder.class)
- : null);
+ return getContext(
+ LogManager.getFactory().isClassLoaderDependent()
+ ? StackLocatorUtil.getCallerClass(LoggerFinder.class)
+ : null);
}
}
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
index cb9d41b..4cc7ae1 100644
--- a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
+++ b/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
@@ -16,10 +16,9 @@
*/
package org.apache.logging.log4j.jpl;
-import java.lang.System.Logger;
-
import aQute.bnd.annotation.Resolution;
import aQute.bnd.annotation.spi.ServiceProvider;
+import java.lang.System.Logger;
/**
* @since 2.14
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
index 1b0da33..85cadb8 100644
--- a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -16,9 +16,16 @@
*/
package org.apache.logging.log4j.jpl;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+
import java.lang.System.Logger;
import java.util.List;
-
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
@@ -27,14 +34,6 @@
import org.junit.Before;
import org.junit.Test;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
-
public class Log4jSystemLoggerTest {
public static final String LOGGER_NAME = "Test";
From a5ee7e6996efd7aeea67b47aa3a9552656ead29c Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Thu, 21 Dec 2023 13:08:12 +0100
Subject: [PATCH 82/86] Adds `useModulePath=false` to `log4j-jpl`
---
log4j-jpl/pom.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index b232754..7ac145d 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -84,6 +84,7 @@
true
+ false
From 77cf1a8f1a448bb022597efc97d3528c9b76e410 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Wed, 20 Dec 2023 00:02:19 +0100
Subject: [PATCH 83/86] Fix JDK used in CI tests
---
log4j-jpl/pom.xml | 48 ++++++++++++++++++++++-------------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 7ac145d..70345ff 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -65,30 +65,26 @@
-
-
- java8-tests
-
-
- env.CI
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- false
-
- true
-
- false
-
-
-
-
-
-
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+
+ run-tests
+
+ test
+
+
+
+ default-test
+ none
+
+
+
+
+
+
From 98d3cab685c637ab2b196fa7569213fd0f618f9c Mon Sep 17 00:00:00 2001
From: Ninette Adhikari <13760198+ninetteadhikari@users.noreply.github.com>
Date: Fri, 27 Sep 2024 16:44:38 +0200
Subject: [PATCH 84/86] Migrate `log4j-jpl` tests to JUnit 5 (#3029)
Signed-off-by: Ninette Adhikari
---
log4j-jpl/pom.xml | 5 -----
.../log4j/jpl/Log4jSystemLoggerTest.java | 18 +++++++++---------
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/log4j-jpl/pom.xml b/log4j-jpl/pom.xml
index 70345ff..736a95f 100644
--- a/log4j-jpl/pom.xml
+++ b/log4j-jpl/pom.xml
@@ -58,11 +58,6 @@
junit-jupiter-engine
test
-
- org.junit.vintage
- junit-vintage-engine
- test
-
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
index 85cadb8..cac01a7 100644
--- a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
+++ b/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
@@ -16,13 +16,13 @@
*/
package org.apache.logging.log4j.jpl;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
import java.lang.System.Logger;
import java.util.List;
@@ -30,9 +30,9 @@
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.core.test.appender.ListAppender;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
public class Log4jSystemLoggerTest {
@@ -41,7 +41,7 @@ public class Log4jSystemLoggerTest {
protected ListAppender eventAppender;
protected ListAppender stringAppender;
- @Before
+ @BeforeEach
public void setUp() throws Exception {
logger = System.getLogger(LOGGER_NAME);
assertThat(logger, instanceOf(Log4jSystemLogger.class));
@@ -51,7 +51,7 @@ public void setUp() throws Exception {
assertNotNull(stringAppender);
}
- @After
+ @AfterEach
public void tearDown() throws Exception {
if (eventAppender != null) {
eventAppender.clear();
From 940297f9c9c0fef58c1460eaf02fc03327d57602 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Wed, 6 Nov 2024 12:55:03 +0100
Subject: [PATCH 85/86] Rename `log4j-jpl` to `jpl-to-log4j-api`
---
{log4j-jpl => jpl-to-log4j-api}/pom.xml | 0
.../main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java | 0
.../org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java | 0
.../org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java | 0
.../src/main/java/org/apache/logging/log4j/jpl/package-info.java | 0
.../resources/META-INF/services/java.lang.System$LoggerFinder | 0
.../java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java | 0
.../src/test/resources/log4j2-test.xml | 0
8 files changed, 0 insertions(+), 0 deletions(-)
rename {log4j-jpl => jpl-to-log4j-api}/pom.xml (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/main/java/org/apache/logging/log4j/jpl/package-info.java (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/main/resources/META-INF/services/java.lang.System$LoggerFinder (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java (100%)
rename {log4j-jpl => jpl-to-log4j-api}/src/test/resources/log4j2-test.xml (100%)
diff --git a/log4j-jpl/pom.xml b/jpl-to-log4j-api/pom.xml
similarity index 100%
rename from log4j-jpl/pom.xml
rename to jpl-to-log4j-api/pom.xml
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java b/jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
similarity index 100%
rename from log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
rename to jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLogger.java
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java b/jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
similarity index 100%
rename from log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
rename to jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerAdapter.java
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java b/jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
similarity index 100%
rename from log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
rename to jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerFinder.java
diff --git a/log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java b/jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/package-info.java
similarity index 100%
rename from log4j-jpl/src/main/java/org/apache/logging/log4j/jpl/package-info.java
rename to jpl-to-log4j-api/src/main/java/org/apache/logging/log4j/jpl/package-info.java
diff --git a/log4j-jpl/src/main/resources/META-INF/services/java.lang.System$LoggerFinder b/jpl-to-log4j-api/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
similarity index 100%
rename from log4j-jpl/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
rename to jpl-to-log4j-api/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
diff --git a/log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java b/jpl-to-log4j-api/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
similarity index 100%
rename from log4j-jpl/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
rename to jpl-to-log4j-api/src/test/java/org/apache/logging/log4j/jpl/Log4jSystemLoggerTest.java
diff --git a/log4j-jpl/src/test/resources/log4j2-test.xml b/jpl-to-log4j-api/src/test/resources/log4j2-test.xml
similarity index 100%
rename from log4j-jpl/src/test/resources/log4j2-test.xml
rename to jpl-to-log4j-api/src/test/resources/log4j2-test.xml
From 465f828ee20cc15ed8a85eae137bda283835e857 Mon Sep 17 00:00:00 2001
From: "Piotr P. Karwasz"
Date: Wed, 6 Nov 2024 13:19:53 +0100
Subject: [PATCH 86/86] Fix build
---
jpl-to-log4j-api/pom.xml | 41 +++++++------------
.../services/java.lang.System$LoggerFinder | 16 ++++++++
parent/pom.xml | 6 +++
pom.xml | 7 ++++
4 files changed, 43 insertions(+), 27 deletions(-)
diff --git a/jpl-to-log4j-api/pom.xml b/jpl-to-log4j-api/pom.xml
index 736a95f..05f46b2 100644
--- a/jpl-to-log4j-api/pom.xml
+++ b/jpl-to-log4j-api/pom.xml
@@ -19,67 +19,54 @@
4.0.0
org.apache.logging.log4j
- log4j
+ log4j-jdk-parent
${revision}
- ../log4j-parent
+ ../parent
- log4j-jpl
- Apache Log4j JDK Platform Logging Adapter
+ jpl-to-log4j-api
+ JPL to Log4j API logging bridge
The Apache Log4j implementation of java.lang.System.LoggerFinder
- org.apache.logging.log4j.jpl
+
+ false
+
+ org.apache.logging.jpl.log4j.api
11
+
org.apache.logging.log4j
log4j-api
+
org.apache.logging.log4j
log4j-core
test
+
org.apache.logging.log4j
log4j-core-test
test
+
org.hamcrest
hamcrest
test
+
org.junit.jupiter
junit-jupiter-engine
test
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- run-tests
-
- test
-
-
-
- default-test
- none
-
-
-
-
-
+
diff --git a/jpl-to-log4j-api/src/main/resources/META-INF/services/java.lang.System$LoggerFinder b/jpl-to-log4j-api/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
index b959e7e..0f0f23e 100644
--- a/jpl-to-log4j-api/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
+++ b/jpl-to-log4j-api/src/main/resources/META-INF/services/java.lang.System$LoggerFinder
@@ -1 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
org.apache.logging.log4j.jpl.Log4jSystemLoggerFinder
\ No newline at end of file
diff --git a/parent/pom.xml b/parent/pom.xml
index 65886d1..01efcec 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -71,6 +71,12 @@
import
+
+ org.hamcrest
+ hamcrest
+ ${hamcrest.version}
+
+
org.junit
junit-bom
diff --git a/pom.xml b/pom.xml
index 65a200b..1b8ff72 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,6 +59,7 @@
parent
+ jpl-to-log4j-api
log4j-api-to-jul
@@ -100,6 +101,12 @@
+
+ org.apache.logging.log4j
+ jpl-to-log4j-api
+ ${project.version}
+
+
org.apache.logging.log4j
log4j-api-to-jul