This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch 2.x-docgen in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit ef3f28b5424f19e6da739adeab45ca191a8a9c2c Author: Volkan Yazıcı <[email protected]> AuthorDate: Mon Mar 11 22:34:30 2024 +0100 Bring back files reverted by mistake --- log4j-1.2-api/.log4j-plugin-processing-activator | 1 + log4j-1.2-api/pom.xml | 28 ++------ log4j-cassandra/.log4j-plugin-processing-activator | 1 + log4j-cassandra/pom.xml | 26 ++----- log4j-core-java9/pom.xml | 2 + log4j-core-test/.log4j-plugin-processing-activator | 1 + log4j-core-test/pom.xml | 20 ++---- log4j-core/pom.xml | 72 ++++++++++++++++--- .../appender/rolling/action/ScriptCondition.java | 4 +- log4j-couchdb/.log4j-plugin-processing-activator | 1 + log4j-couchdb/pom.xml | 26 ++----- log4j-docker/.log4j-plugin-processing-activator | 1 + log4j-docker/pom.xml | 32 ++------- log4j-flume-ng/.log4j-plugin-processing-activator | 1 + log4j-flume-ng/pom.xml | 29 ++------ .../.log4j-plugin-processing-activator | 1 + log4j-jakarta-web/pom.xml | 26 +------ .../.log4j-plugin-processing-activator | 1 + log4j-jdbc-dbcp2/pom.xml | 26 ++----- log4j-jpa/.log4j-plugin-processing-activator | 1 + log4j-jpa/pom.xml | 25 ++----- log4j-kubernetes/pom.xml | 29 ++------ log4j-layout-template-json-test/pom.xml | 17 +---- .../.log4j-plugin-processing-activator | 1 + log4j-layout-template-json/pom.xml | 40 +---------- log4j-mongodb3/.log4j-plugin-processing-activator | 1 + log4j-mongodb3/pom.xml | 23 ++---- log4j-mongodb4/.log4j-plugin-processing-activator | 1 + log4j-mongodb4/pom.xml | 23 ++---- log4j-osgi-test/.log4j-plugin-processing-activator | 1 + log4j-osgi-test/pom.xml | 29 +++----- log4j-parent/pom.xml | 81 ++++++++++++++++++++++ .../.log4j-plugin-processing-activator | 1 + log4j-spring-boot/pom.xml | 29 ++------ log4j-web/pom.xml | 27 +------- src/site/_release-notes/_2.x.x.adoc | 5 +- src/site/site.xml | 2 + 37 files changed, 241 insertions(+), 394 deletions(-) diff --git a/log4j-1.2-api/.log4j-plugin-processing-activator b/log4j-1.2-api/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-1.2-api/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-1.2-api/pom.xml b/log4j-1.2-api/pom.xml index 58c18dd5bc..b9f286d49a 100644 --- a/log4j-1.2-api/pom.xml +++ b/log4j-1.2-api/pom.xml @@ -16,17 +16,21 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-1.2-api</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j 1.x Compatibility API</name> <description>The Apache Log4j 1.x Compatibility API</description> + <properties> <module.name>org.apache.log4j</module.name> @@ -45,6 +49,7 @@ <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host> <!-- we have an `bnd.bnd` file to override the parent's defaults --> </properties> + <dependencies> <!-- Used for JMS appenders (needs an implementation of course) --> <dependency> @@ -138,27 +143,6 @@ </dependency> </dependencies> - <build> - <plugins> - - <!-- Enable Log4j plugin processing --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - - </plugins> - </build> - <profiles> <!-- Fixes incompatible with Java 8 --> diff --git a/log4j-cassandra/.log4j-plugin-processing-activator b/log4j-cassandra/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-cassandra/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-cassandra/pom.xml b/log4j-cassandra/pom.xml index f0ae5007f2..a248ca734b 100644 --- a/log4j-cassandra/pom.xml +++ b/log4j-cassandra/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,8 +27,10 @@ </parent> <artifactId>log4j-cassandra</artifactId> + <name>Apache Log4j Cassandra</name> <description>Cassandra appender for Log4j.</description> + <properties> <!-- @@ -108,26 +112,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-core-java9/pom.xml b/log4j-core-java9/pom.xml index 6b6c0e0b25..bf1d9dc9ea 100644 --- a/log4j-core-java9/pom.xml +++ b/log4j-core-java9/pom.xml @@ -30,6 +30,8 @@ <properties> <maven.compiler.release>9</maven.compiler.release> <maven.deploy.skip>true</maven.deploy.skip> + <maven.install.skip>true</maven.install.skip> + <sign.skip>true</sign.skip> </properties> <dependencies> <!-- Naturally, all implementations require the log4j-api JAR --> diff --git a/log4j-core-test/.log4j-plugin-processing-activator b/log4j-core-test/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-core-test/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-core-test/pom.xml b/log4j-core-test/pom.xml index 1155ed9989..ac718f0e72 100644 --- a/log4j-core-test/pom.xml +++ b/log4j-core-test/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,9 +27,10 @@ </parent> <artifactId>log4j-core-test</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Core Tests</name> <description>The Apache Log4j Implementation Tests</description> + <properties> <!-- Ignore less important (high rank) bugs for test artifacts --> <spotbugs.maxRank>9</spotbugs.maxRank> @@ -351,21 +354,6 @@ <build> <plugins> - <!-- Enable Log4j plugin processing --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml index 4fa7392c89..0f51b1e488 100644 --- a/log4j-core/pom.xml +++ b/log4j-core/pom.xml @@ -16,20 +16,28 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-core</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Core</name> <description>The Apache Log4j Implementation</description> + <properties> + <javadoc.skip>false</javadoc.skip> + <!-- Tests are located elsewhere, no need to do any processing for the `src/test` directory: --> + <maven.test.skip>true</maven.test.skip> + <!-- ~ OSGi and JPMS options --> @@ -82,6 +90,7 @@ javax.mail.api;substitute="javax.mail-api";transitive=false;static=true </bnd-extra-module-options> </properties> + <dependencies> <dependency> <groupId>javax.activation</groupId> @@ -200,6 +209,7 @@ <optional>true</optional> </dependency> </dependencies> + <build> <plugins> @@ -207,6 +217,8 @@ <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <executions> + + <!-- Add Java 9+ code for the MRJ --> <execution> <id>add-source</id> <goals> @@ -219,36 +231,74 @@ </sources> </configuration> </execution> + + <!-- Attach the generated `log4j-plugins.xml` --> + <execution> + <id>attach-plugin-descriptor</id> + <goals> + <goal>attach-artifact</goal> + </goals> + <phase>package</phase> + <configuration> + <artifacts> + <artifact> + <file>${project.build.directory}/log4j-plugins.xml</file> + <type>xml</type> + <classifier>log4j-plugins</classifier> + </artifact> + </artifacts> + </configuration> + </execution> + </executions> </plugin> + <!-- We can't use `plugin-processing` Maven profile activated by `.log4j-plugin-processing-activator` file, because... + `log4j-core` contains `PluginProcessor`, that is responsible for generating `META-INF/org/apache/.../Log4j2Plugins.dat` from `@Plugin`-annotated members. + `log4j-core` also contains `@Plugin`-annotated members too. + That is, we need `log4j-core` to build `log4j-core`. + To work around this chicken-and-egg problem, we build as follows: + + 1. Compile sources using the `default-compile` default compilation execution. + This will generate the `PluginProcessor` class. + + 2. Make a second compilation pass using the generated `PluginProcessor`. --> <plugin> <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths combine.self="override" /> - </configuration> <executions> + + <!-- Compile sources as usual --> <execution> - <!-- disable annotation processing for first pass --> <id>default-compile</id> <configuration> - <annotationProcessorPaths> + <annotationProcessorPaths combine.children="append"> + <!-- `org.apache.logging.log4j.docgen.processor.DescriptorGenerator` for generating `log4j-plugins.xml`: --> <path> - <groupId>com.google.errorprone</groupId> - <artifactId>error_prone_core</artifactId> - <version>${error-prone.version}</version> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-docgen</artifactId> + <version>${log4j-docgen.version}</version> </path> </annotationProcessorPaths> + <compilerArgs combine.children="append"> + <!-- Provide `org.apache.logging.log4j.docgen.processor.DescriptorGenerator` arguments: --> + <arg>-Alog4j.docgen.descriptorFilePath=${project.build.directory}/log4j-plugins.xml</arg> + <arg>-Alog4j.docgen.groupId=${project.groupId}</arg> + <arg>-Alog4j.docgen.artifactId=${project.artifactId}</arg> + <arg>-Alog4j.docgen.version=${project.version}</arg> + <arg>-Alog4j.docgen.description=${project.description}</arg> + </compilerArgs> </configuration> </execution> + + <!-- Process sources using `PluginProcessor` to generate `META-INF/org/apache/.../Log4j2Plugins.dat` --> <execution> - <!-- then do a processing-only pass to generate plugins .dat file --> <id>process-plugins</id> <goals> <goal>compile</goal> </goals> <phase>process-classes</phase> <configuration> + <annotationProcessorPaths combine.self="override" /> <annotationProcessors> <processor>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</processor> </annotationProcessors> @@ -256,6 +306,7 @@ <proc>only</proc> </configuration> </execution> + </executions> </plugin> @@ -291,4 +342,5 @@ </plugins> </build> + </project> diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java index 87e439a5f2..3519980c2a 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/ScriptCondition.java @@ -89,8 +89,8 @@ public class ScriptCondition { * <li>pathList - a {@code java.util.List} containing {@link org.apache.logging.log4j.core.appender.rolling.action.PathWithAttributes} objects. (The script is * free to modify and return this list.)</li> * <li>substitutor - a {@link org.apache.logging.log4j.core.lookup.StrSubstitutor} that can be used to look up variables embedded in the base - * dir or other properties - * <li>statusLogger - the {@link StatusLogger} that can be used to log events during script execution + * dir or other properties</li> + * <li>statusLogger - the {@link StatusLogger} that can be used to log events during script execution</li> * <li>any properties declared in the configuration</li> * </ul> * @param configuration the configuration diff --git a/log4j-couchdb/.log4j-plugin-processing-activator b/log4j-couchdb/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-couchdb/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-couchdb/pom.xml b/log4j-couchdb/pom.xml index ac65c693e0..63ce30aaf4 100644 --- a/log4j-couchdb/pom.xml +++ b/log4j-couchdb/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,8 +27,10 @@ </parent> <artifactId>log4j-couchdb</artifactId> + <name>Apache Log4j CouchDB</name> <description>CouchDB appender for Log4j.</description> + <properties> <!-- @@ -81,26 +85,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-docker/.log4j-plugin-processing-activator b/log4j-docker/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-docker/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-docker/pom.xml b/log4j-docker/pom.xml index 7682421d2b..2b6bb357dc 100644 --- a/log4j-docker/pom.xml +++ b/log4j-docker/pom.xml @@ -16,17 +16,21 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-docker</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Docker Library</name> <description>Apache Log4j Docker Support</description> + <properties> <!-- @@ -34,6 +38,7 @@ --> <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host> </properties> + <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -63,29 +68,4 @@ </dependency> </dependencies> - <build> - <plugins> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - - </plugins> - </build> - </project> diff --git a/log4j-flume-ng/.log4j-plugin-processing-activator b/log4j-flume-ng/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-flume-ng/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-flume-ng/pom.xml b/log4j-flume-ng/pom.xml index c3bffe0ec5..6af2f7c517 100644 --- a/log4j-flume-ng/pom.xml +++ b/log4j-flume-ng/pom.xml @@ -16,17 +16,21 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-flume-ng</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Flume Bridge</name> <description>The Apache Log4j Flume Appender</description> + <properties> <!-- @@ -39,6 +43,7 @@ </bnd-extra-module-options> <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host> </properties> + <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -113,26 +118,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-jakarta-web/.log4j-plugin-processing-activator b/log4j-jakarta-web/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-jakarta-web/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-jakarta-web/pom.xml b/log4j-jakarta-web/pom.xml index a3f81e5146..f3434f9f85 100644 --- a/log4j-jakarta-web/pom.xml +++ b/log4j-jakarta-web/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,7 +27,7 @@ </parent> <artifactId>log4j-jakarta-web</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Jakarta Web</name> <description>The Apache Log4j support for Jakarta EE 9+ web servlet containers</description> @@ -79,26 +81,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-jdbc-dbcp2/.log4j-plugin-processing-activator b/log4j-jdbc-dbcp2/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-jdbc-dbcp2/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-jdbc-dbcp2/pom.xml b/log4j-jdbc-dbcp2/pom.xml index 50196e3cc9..95522b7c1f 100644 --- a/log4j-jdbc-dbcp2/pom.xml +++ b/log4j-jdbc-dbcp2/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,8 +27,10 @@ </parent> <artifactId>log4j-jdbc-dbcp2</artifactId> + <name>Apache Log4j JDBC DBCP 2</name> <description>Connection source for the JDBC Appender using Apache Commons DBCP2.</description> + <properties> <!-- @@ -73,26 +77,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-jpa/.log4j-plugin-processing-activator b/log4j-jpa/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-jpa/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-jpa/pom.xml b/log4j-jpa/pom.xml index e90cd50e2a..b2c873b12a 100644 --- a/log4j-jpa/pom.xml +++ b/log4j-jpa/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,8 +27,10 @@ </parent> <artifactId>log4j-jpa</artifactId> + <name>Apache Log4j JPA</name> <description>Apache Log4j Java Persistence API Appender.</description> + <properties> <!-- @@ -93,27 +97,6 @@ </dependency> </dependencies> - <build> - <plugins> - - <!-- Enable Log4j plugin processing --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - - </plugins> - </build> - <profiles> <!-- Fixes incompatible with Java 8 --> diff --git a/log4j-kubernetes/pom.xml b/log4j-kubernetes/pom.xml index 47313c6b12..359f9ef483 100644 --- a/log4j-kubernetes/pom.xml +++ b/log4j-kubernetes/pom.xml @@ -16,17 +16,21 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-kubernetes</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Kubernetes Library</name> <description>Apache Log4j Kubernetes Support</description> + <properties> <!-- @@ -39,6 +43,7 @@ </bnd-extra-module-options> <Fragment-Host>org.apache.logging.log4j.core</Fragment-Host> </properties> + <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -65,26 +70,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-layout-template-json-test/pom.xml b/log4j-layout-template-json-test/pom.xml index 30b1dac1f8..20c9d9d155 100644 --- a/log4j-layout-template-json-test/pom.xml +++ b/log4j-layout-template-json-test/pom.xml @@ -27,11 +27,13 @@ </parent> <artifactId>log4j-layout-template-json-test</artifactId> + <name>Apache Log4j JSON Template Layout tests</name> <properties> <maven.deploy.skip>true</maven.deploy.skip> + <maven.install.skip>true</maven.install.skip> <sign.skip>true</sign.skip> <!-- @@ -126,21 +128,6 @@ <build> <plugins> - <!-- Modules that contain `log4j-core` plugins, must be compiled with: `org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor` --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - <!-- Disable ITs, which are Docker-dependent, by default. --> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/log4j-layout-template-json/.log4j-plugin-processing-activator b/log4j-layout-template-json/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-layout-template-json/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-layout-template-json/pom.xml b/log4j-layout-template-json/pom.xml index 369d38d7ff..9b1351fae3 100644 --- a/log4j-layout-template-json/pom.xml +++ b/log4j-layout-template-json/pom.xml @@ -27,6 +27,7 @@ </parent> <artifactId>log4j-layout-template-json</artifactId> + <name>Apache Log4j JSON Template Layout</name> <description>Apache Log4j Layout for producing JSON output that is structured according to a user-provided template.</description> @@ -63,43 +64,4 @@ </dependencies> - <build> - <plugins> - - <!-- Modules that contain `log4j-core` plugins, must be compiled with: `org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor` --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - - <!-- Disable Failsafe, tests are in the `-test` module. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - - <!-- Disable Surefire, tests are in the `-test` module. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - - </plugins> - </build> - </project> diff --git a/log4j-mongodb3/.log4j-plugin-processing-activator b/log4j-mongodb3/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-mongodb3/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-mongodb3/pom.xml b/log4j-mongodb3/pom.xml index 94fd94dc3e..e5e285b017 100644 --- a/log4j-mongodb3/pom.xml +++ b/log4j-mongodb3/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,8 +27,10 @@ </parent> <artifactId>log4j-mongodb3</artifactId> + <name>Apache Log4j MongoDB 3</name> <description>MongoDB appender for Log4j using the MongoDB 3 driver API.</description> + <properties> <!-- @@ -146,25 +150,6 @@ <build> <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> diff --git a/log4j-mongodb4/.log4j-plugin-processing-activator b/log4j-mongodb4/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-mongodb4/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-mongodb4/pom.xml b/log4j-mongodb4/pom.xml index 098f1f76af..da17281813 100644 --- a/log4j-mongodb4/pom.xml +++ b/log4j-mongodb4/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,8 +27,10 @@ </parent> <artifactId>log4j-mongodb4</artifactId> + <name>Apache Log4j MongoDB 4</name> <description>MongoDB appender for Log4j using the MongoDB 4 driver API.</description> + <properties> <!-- @@ -108,25 +112,6 @@ <build> <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> diff --git a/log4j-osgi-test/.log4j-plugin-processing-activator b/log4j-osgi-test/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-osgi-test/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-osgi-test/pom.xml b/log4j-osgi-test/pom.xml index 7f8b52961e..19dcd37e65 100644 --- a/log4j-osgi-test/pom.xml +++ b/log4j-osgi-test/pom.xml @@ -16,17 +16,21 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-osgi-test</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j OSGi tests</name> <description>The Apache Log4j OSGi tests</description> + <properties> <module.name>org.apache.logging.log4j.osgi</module.name> <bnd.baseline.skip>true</bnd.baseline.skip> @@ -37,6 +41,7 @@ <spotbugs.skip>true</spotbugs.skip> <spifly.version>1.3.7</spifly.version> </properties> + <dependencies> <dependency> <groupId>javax.inject</groupId> @@ -135,7 +140,9 @@ <scope>test</scope> </dependency> </dependencies> + <build> + <testResources> <testResource> <!-- Enable variable interpolation in resources --> @@ -143,6 +150,7 @@ <directory>src/test/resources</directory> </testResource> </testResources> + <plugins> <!-- @@ -180,25 +188,6 @@ </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> diff --git a/log4j-parent/pom.xml b/log4j-parent/pom.xml index 5517c43c0c..3f11b042ff 100644 --- a/log4j-parent/pom.xml +++ b/log4j-parent/pom.xml @@ -1196,4 +1196,85 @@ </plugins> </build> + <profiles> + + <!-- `plugin-processing` profile containing configuration specific to `@Plugin`-annotated members --> + <profile> + + <id>plugin-processing</id> + + <!-- Profile gets activated using a file instead of, say, a property. + Since a Maven property lookup requires model interpolation and that hasn't happened at this stage yet. + See: https://maven.apache.org/ref/3.9.6/maven-model-builder --> + <activation> + <file> + <exists>.log4j-plugin-processing-activator</exists> + </file> + </activation> + + <build> + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths combine.children="append"> + <!-- Include `org.apache.logging.log4j.docgen.processor.DescriptorGenerator` that generates `log4j-plugins.xml`. + `DescriptorGenerator` must precede `PluginProcessor`, since the latter *claims* the `@Plugin`. + Once claimed, `javac` doesn't pass those sources to other processors. --> + <path> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-docgen</artifactId> + <version>${log4j-docgen.version}</version> + </path> + <!-- `org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor` for generating `META-INF/org/apache/.../Log4j2Plugins.dat`: --> + <path> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>${project.version}</version> + </path> + </annotationProcessorPaths> + <compilerArgs combine.children="append"> + <!-- Provide `org.apache.logging.log4j.docgen.processor.DescriptorGenerator` arguments: --> + <arg>-Alog4j.docgen.descriptorFilePath=${project.build.directory}/log4j-plugins.xml</arg> + <arg>-Alog4j.docgen.groupId=${project.groupId}</arg> + <arg>-Alog4j.docgen.artifactId=${project.artifactId}</arg> + <arg>-Alog4j.docgen.version=${project.version}</arg> + <arg>-Alog4j.docgen.description=${project.description}</arg> + </compilerArgs> + </configuration> + </plugin> + + <!-- Attach the generated `log4j-plugins.xml` --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>attach-plugin-descriptor</id> + <goals> + <goal>attach-artifact</goal> + </goals> + <phase>package</phase> + <configuration> + <artifacts> + <artifact> + <file>${project.build.directory}/log4j-plugins.xml</file> + <type>xml</type> + <classifier>log4j-plugins</classifier> + </artifact> + </artifacts> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> + + </profile> + + </profiles> + </project> diff --git a/log4j-spring-boot/.log4j-plugin-processing-activator b/log4j-spring-boot/.log4j-plugin-processing-activator new file mode 100644 index 0000000000..ba133f3696 --- /dev/null +++ b/log4j-spring-boot/.log4j-plugin-processing-activator @@ -0,0 +1 @@ +This file is here to activate the `plugin-processing` Maven profile. diff --git a/log4j-spring-boot/pom.xml b/log4j-spring-boot/pom.xml index 342489bbb4..08d2aaf3ba 100644 --- a/log4j-spring-boot/pom.xml +++ b/log4j-spring-boot/pom.xml @@ -16,19 +16,22 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>${revision}</version> <relativePath>../log4j-parent</relativePath> </parent> + <artifactId>log4j-spring-boot</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Spring Boot Support</name> <description>Apache Log4j Spring Boot Support</description> - <properties> + <properties> <!-- ~ OSGi and JPMS options --> @@ -120,26 +123,4 @@ </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> </project> diff --git a/log4j-web/pom.xml b/log4j-web/pom.xml index 287cd9a583..aa8b482ef9 100644 --- a/log4j-web/pom.xml +++ b/log4j-web/pom.xml @@ -16,7 +16,9 @@ ~ limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> @@ -25,7 +27,7 @@ </parent> <artifactId>log4j-web</artifactId> - <packaging>jar</packaging> + <name>Apache Log4j Web</name> <description>The Apache Log4j support for web servlet containers</description> @@ -88,27 +90,4 @@ </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <!-- - ~ Modules that contain `log4j-core` plugins, must be compiled with: - ~ - ~ org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor - --> - <annotationProcessorPaths combine.children="append"> - <path> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>${project.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> - </project> diff --git a/src/site/_release-notes/_2.x.x.adoc b/src/site/_release-notes/_2.x.x.adoc index d7acc079e2..8c4ffcc0e4 100644 --- a/src/site/_release-notes/_2.x.x.adoc +++ b/src/site/_release-notes/_2.x.x.adoc @@ -31,8 +31,9 @@ This releases contains ... [#release-notes-2-x-x-fixed] === Fixed -* Add `log4j2.StatusLogger.DateFormatZone` system property to set the time-zone `StatusLogger` uses to format `java.time.Instant`. Without this formatting patterns accessing to time-zone-specific fields (e.g., year-of-era) cause failures. -* Fix stack overflow in `StatusLogger` +* Fix `StatusLogger` log level filtering when debug mode is enabled (https://github.com/apache/logging-log4j2/issues/2337[2337]) +* Add `log4j2.StatusLogger.DateFormatZone` system property to set the time-zone `StatusLogger` uses to format `java.time.Instant`. Without this formatting patterns accessing to time-zone-specific fields (e.g., year-of-era) cause failures. (https://github.com/apache/logging-log4j2/pull/2322[2322]) +* Fix stack overflow in `StatusLogger` (https://github.com/apache/logging-log4j2/pull/2322[2322]) [#release-notes-2-x-x-updated] === Updated diff --git a/src/site/site.xml b/src/site/site.xml index 75c89e075e..f8882530f6 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -277,6 +277,8 @@ <item name="Developer Notes" href="/manual/plugins.html#DeveloperNotes"/> </item> + <item name="Plugin reference" href="/plugin-reference.html"/> + <item name="Programmatic Log4j Configuration" href="/manual/customconfig.html" collapse="true"> <item name="ConfigurationBuilder API" href="/manual/customconfig.html#ConfigurationBuilder"/> <item name="Understanding ConfigurationFactory" href="/manual/customconfig.html#ConfigurationFactory"/>
