You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2024/03/19 21:19:27 UTC
(logging-log4j2) 01/01: Implement docgen integration
This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch 3.x-docgen
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 057ec1881665309d1a53c6e91df088bd09563028
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Tue Mar 19 22:19:13 2024 +0100
Implement docgen integration
---
log4j-1.2-api/.log4j-plugin-processing-activator | 1 +
log4j-1.2-api/pom.xml | 20 +--
.../.log4j-plugin-processing-activator | 1 +
log4j-async-logger/pom.xml | 19 +--
.../.log4j-plugin-processing-activator | 1 +
log4j-config-properties/pom.xml | 19 +--
.../.log4j-plugin-processing-activator | 1 +
log4j-config-yaml/pom.xml | 19 +--
log4j-core-test/.log4j-plugin-processing-activator | 1 +
log4j-core-test/pom.xml | 33 +----
log4j-core/.log4j-plugin-processing-activator | 1 +
log4j-core/pom.xml | 36 ++---
.../java/org/apache/logging/log4j/core/Layout.java | 2 +-
log4j-csv/.log4j-plugin-processing-activator | 1 +
log4j-csv/pom.xml | 20 +--
log4j-docker/.log4j-plugin-processing-activator | 1 +
log4j-docker/pom.xml | 25 +---
log4j-flume-ng/.log4j-plugin-processing-activator | 1 +
log4j-flume-ng/pom.xml | 21 +--
.../.log4j-plugin-processing-activator | 1 +
log4j-jdbc-dbcp2/pom.xml | 20 +--
log4j-jdbc/.log4j-plugin-processing-activator | 1 +
log4j-jdbc/pom.xml | 18 +--
log4j-jndi/.log4j-plugin-processing-activator | 1 +
log4j-jndi/pom.xml | 21 +--
log4j-jul/pom.xml | 13 --
.../.log4j-plugin-processing-activator | 1 +
log4j-kubernetes/pom.xml | 22 +---
.../.log4j-plugin-processing-activator | 1 +
log4j-layout-template-json-test/pom.xml | 70 +++++-----
.../.log4j-plugin-processing-activator | 1 +
log4j-layout-template-json/pom.xml | 45 ++-----
log4j-mongodb4/.log4j-plugin-processing-activator | 1 +
log4j-mongodb4/pom.xml | 18 +--
log4j-osgi-test/.log4j-plugin-processing-activator | 1 +
log4j-osgi-test/pom.xml | 22 ++--
log4j-parent/pom.xml | 115 ++++++++++++++++
log4j-plugin-processor/pom.xml | 8 ++
.../.log4j-plugin-processing-activator | 1 +
log4j-plugins-test/pom.xml | 21 +--
log4j-script/.log4j-plugin-processing-activator | 1 +
log4j-script/pom.xml | 19 +--
.../appender/rolling/action/ScriptCondition.java | 4 +-
pom.xml | 135 +++++++++++++++++--
src/asciidoc/templates/document.html.erb | 1 +
src/docgen-templates/index.adoc.ftl | 60 +++++++++
src/docgen-templates/license.adoc | 16 +++
src/docgen-templates/type.adoc.ftl | 146 +++++++++++++++++++++
48 files changed, 617 insertions(+), 390 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 6e38bbee4e..e53d42ddf6 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>
<log4jParentDir>${basedir}/..</log4jParentDir>
@@ -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>
<dependency>
<groupId>javax.jms</groupId>
@@ -127,21 +132,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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
-
<!-- Illegal access is disabled by default in Java 16 due to JEP-396.
We are relaxing it for tests. -->
<plugin>
diff --git a/log4j-async-logger/.log4j-plugin-processing-activator b/log4j-async-logger/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-async-logger/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-async-logger/pom.xml b/log4j-async-logger/pom.xml
index aba22bd83d..c9f7379845 100644
--- a/log4j-async-logger/pom.xml
+++ b/log4j-async-logger/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>
@@ -66,21 +68,4 @@
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-config-properties/.log4j-plugin-processing-activator b/log4j-config-properties/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-config-properties/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-config-properties/pom.xml b/log4j-config-properties/pom.xml
index 35aa18e1a5..14a6a5691c 100644
--- a/log4j-config-properties/pom.xml
+++ b/log4j-config-properties/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>
@@ -48,21 +50,4 @@
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-config-yaml/.log4j-plugin-processing-activator b/log4j-config-yaml/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-config-yaml/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-config-yaml/pom.xml b/log4j-config-yaml/pom.xml
index c09c0fa0b4..8b02dd275d 100644
--- a/log4j-config-yaml/pom.xml
+++ b/log4j-config-yaml/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>
@@ -48,21 +50,4 @@
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
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 2bdec622f7..e893432684 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>
@@ -28,6 +30,7 @@
<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>
@@ -58,6 +61,7 @@
spring.test;substitute="spring-test"
</bnd-extra-module-options>
</properties>
+
<dependencies>
<!-- Used for OSGi bundle support -->
<dependency>
@@ -288,35 +292,10 @@
<scope>test</scope>
</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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- <executions>
- <execution>
- <id>default-testCompile</id>
- <configuration>
- <compilerArgs combine.children="append">
- <!-- Disable automatic package discovery, which overwrites `log4j-core` plugins. -->
- <arg>-ApluginPackage=org.apache.logging.log4j.core.test2</arg>
- </compilerArgs>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
@@ -344,6 +323,7 @@
</plugins>
</build>
+
<profiles>
<profile>
<id>fast-test</id>
@@ -359,4 +339,5 @@
</build>
</profile>
</profiles>
+
</project>
diff --git a/log4j-core/.log4j-plugin-processing-activator b/log4j-core/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-core/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml
index e676d00b87..66a444575f 100644
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -16,20 +16,27 @@
~ 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>
<maven.javadoc.skip>false</maven.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
-->
@@ -62,7 +69,10 @@
jdk.unsupported;transitive=false,
org.fusesource.jansi;transitive=false,
</bnd-extra-module-options>
+
+ <log4j.docgen.pluginDescriptorsDir.effective>${log4j.docgen.pluginDescriptorsDir.phase1}</log4j.docgen.pluginDescriptorsDir.effective>
</properties>
+
<dependencies>
<!-- Naturally, all implementations require the log4j-api JAR -->
<dependency>
@@ -99,31 +109,5 @@
<optional>true</optional>
</dependency>
</dependencies>
- <build>
- <plugins>
-
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/Layout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/Layout.java
index 1821103ad2..62641d810e 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/Layout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/Layout.java
@@ -24,7 +24,7 @@ import org.apache.logging.log4j.core.layout.Encoder;
/**
* Converts {@link LogEvent} instances into different layouts of data. A layout typically encodes into either
- * a {@link String} or {@code byte[]}. Since version 2.6, layouts implement {@link Encoder Encoder<LogEvent>}
+ * a {@link String} or {@code byte[]}. Since version 2.6, layouts implement {@link Encoder}
* to support direct encoding of a log event into a {@link ByteBufferDestination} without creating temporary
* intermediary objects. Since version 3.0.0, layouts no longer reference the legacy Java serialization API
* and are limited to strings or bytes.
diff --git a/log4j-csv/.log4j-plugin-processing-activator b/log4j-csv/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-csv/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-csv/pom.xml b/log4j-csv/pom.xml
index 9556eb32a2..5c617c1b0b 100644
--- a/log4j-csv/pom.xml
+++ b/log4j-csv/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>
@@ -27,6 +29,7 @@
<artifactId>log4j-csv</artifactId>
<name>Apache Log4j CSV</name>
<description>Apache Log4j CSV Layout.</description>
+
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
@@ -92,21 +95,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</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 890688836e..2b6c19f09e 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>
<!--
@@ -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>
@@ -68,24 +73,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
-
- <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-plugin-processor</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 1502520b8c..fcfdff50f0 100644
--- a/log4j-flume-ng/pom.xml
+++ b/log4j-flume-ng/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>
@@ -28,6 +30,7 @@
<packaging>jar</packaging>
<name>Apache Log4j Flume Bridge</name>
<description>The Apache Log4j Flume Appender</description>
+
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
@@ -41,6 +44,7 @@
</bnd-extra-module-options>
<Fragment-Host>org.apache.logging.log4j.core</Fragment-Host>
</properties>
+
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -115,21 +119,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</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 ec67a8828e..70882c37f0 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>
@@ -27,6 +29,7 @@
<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>
<!--
@@ -86,21 +89,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-jdbc/.log4j-plugin-processing-activator b/log4j-jdbc/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-jdbc/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-jdbc/pom.xml b/log4j-jdbc/pom.xml
index 5b247493e1..ebfd698839 100644
--- a/log4j-jdbc/pom.xml
+++ b/log4j-jdbc/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>
@@ -27,6 +29,7 @@
<artifactId>log4j-jdbc</artifactId>
<name>Apache Log4j JDBC</name>
<description>Apache Log4j Java Database Connectivity (JDBC).</description>
+
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
@@ -115,20 +118,6 @@
<build>
<plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@@ -144,4 +133,5 @@
</plugins>
</build>
+
</project>
diff --git a/log4j-jndi/.log4j-plugin-processing-activator b/log4j-jndi/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-jndi/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-jndi/pom.xml b/log4j-jndi/pom.xml
index fe20c57a27..2ac3318322 100644
--- a/log4j-jndi/pom.xml
+++ b/log4j-jndi/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>
@@ -28,10 +30,12 @@
<packaging>jar</packaging>
<name>Apache Log4j JNDI Support</name>
<description>The Apache Log4j JNDI Support</description>
+
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
<module.name>org.apache.logging.log4j.jndi</module.name>
</properties>
+
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -43,21 +47,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-jul/pom.xml b/log4j-jul/pom.xml
index 5fb2704a4c..84b1f81dc1 100644
--- a/log4j-jul/pom.xml
+++ b/log4j-jul/pom.xml
@@ -85,19 +85,6 @@
<build>
<plugins>
- <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-plugin-processor</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-kubernetes/.log4j-plugin-processing-activator b/log4j-kubernetes/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-kubernetes/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-kubernetes/pom.xml b/log4j-kubernetes/pom.xml
index 9162c079fd..267dd6bd40 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,21 +70,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-layout-template-json-test/.log4j-plugin-processing-activator b/log4j-layout-template-json-test/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-layout-template-json-test/.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-test/pom.xml b/log4j-layout-template-json-test/pom.xml
index da4d69599b..a87e8d1874 100644
--- a/log4j-layout-template-json-test/pom.xml
+++ b/log4j-layout-template-json-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/xsd/maven-4.0.0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
@@ -38,99 +40,90 @@
</properties>
<dependencies>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-layout-template-json</artifactId>
</dependency>
+
<!-- needed for `MessageResolverTest#log4j1_logger_calls_should_use_fallbackKey` -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-config-properties</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-config-yaml</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core-test</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>com.google.code.java-allocation-instrumenter</groupId>
<artifactId>java-allocation-instrumenter</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>log4j2-ecs-layout</artifactId>
<scope>test</scope>
</dependency>
+
</dependencies>
<build>
<plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- <executions>
- <execution>
- <id>default-testCompile</id>
- <configuration>
- <compilerArgs combine.children="append">
- <!-- Disable automatic package discovery, which overwrites `log4j-layout-template-json` plugins. -->
- <arg>-ApluginPackage=org.apache.logging.log4j.layout.template.json.test</arg>
- </compilerArgs>
- </configuration>
- </execution>
- </executions>
- </plugin>
+
<!-- Disable ITs, which are Docker-dependent, by default. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -147,6 +140,7 @@
</execution>
</executions>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -162,17 +156,29 @@
</systemPropertyVariables>
</configuration>
</plugin>
+
</plugins>
</build>
<profiles>
<profile>
+
<id>docker</id>
+
<activation>
<activeByDefault>false</activeByDefault>
</activation>
+
+ <properties>
+ <elastic.version>8.10.2</elastic.version>
+ <!-- `docker run elasticsearch:<TAG>` exists with code 137 due to insufficient memory.
+ We limit the used JVM memory to avoid this OOM failure. -->
+ <elastic.java-opts>-Xms750m -Xmx750m</elastic.java-opts>
+ </properties>
+
<build>
<plugins>
+
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
@@ -183,14 +189,13 @@
<images>
<image>
<alias>elasticsearch</alias>
- <name>docker.elastic.co/elasticsearch/elasticsearch:8.2.2</name>
+ <name>elasticsearch:${elastic.version}</name>
<run>
<env>
- <xpack.security.enabled>false</xpack.security.enabled>
<discovery.type>single-node</discovery.type>
+ <xpack.security.enabled>false</xpack.security.enabled>
+ <ES_JAVA_OPTS>${elastic.java-opts}</ES_JAVA_OPTS>
</env>
- <memory>1000000000</memory>
- <!-- 1g -->
<ports>
<port>9200:9200</port>
</ports>
@@ -211,7 +216,7 @@
</image>
<image>
<alias>logstash</alias>
- <name>docker.elastic.co/logstash/logstash:8.2.2</name>
+ <name>logstash:${elastic.version}</name>
<run>
<dependsOn>
<container>elasticsearch</container>
@@ -221,6 +226,9 @@
<name>log4j-layout-template-json-network</name>
<alias>logstash</alias>
</network>
+ <env>
+ <LS_JAVA_OPTS>${elastic.java-opts}</LS_JAVA_OPTS>
+ </env>
<ports>
<port>12222:12222</port>
<port>12345:12345</port>
@@ -306,11 +314,11 @@
</execution>
</executions>
</plugin>
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
- <skip>false</skip>
<includes>
<include>**/*IT.java</include>
</includes>
@@ -324,8 +332,10 @@
</execution>
</executions>
</plugin>
+
</plugins>
</build>
+
</profile>
</profiles>
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 866c8180fb..e2682a71cf 100644
--- a/log4j-layout-template-json/pom.xml
+++ b/log4j-layout-template-json/pom.xml
@@ -32,6 +32,10 @@
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
+ <!-- Using `maven.test.skip` instead of `skipTests`, since there are no tests.
+ That is, there is nothing to compile. -->
+ <maven.test.skip>true</maven.test.skip>
+
<!--
~ OSGi and JPMS options
-->
@@ -40,55 +44,22 @@
</properties>
<dependencies>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-plugins</artifactId>
</dependency>
- </dependencies>
- <build>
- <plugins>
-
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
-
- <!-- Disable Failsafe since tests go to the `-test` module. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
+ </dependencies>
</project>
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 6292a1e3ff..f92c2ab0c8 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>
@@ -27,8 +29,8 @@
<artifactId>log4j-mongodb4</artifactId>
<name>Apache Log4j MongoDB 4</name>
<description>MongoDB appender for Log4j using the MongoDB 4 driver API.</description>
- <properties>
+ <properties>
<!--
~ OSGi and JPMS options
-->
@@ -116,20 +118,6 @@
<build>
<plugins>
- <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-plugin-processor</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 ad9fc96e19..20722f8542 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>
@@ -136,7 +141,9 @@
<scope>test</scope>
</dependency>
</dependencies>
+
<build>
+
<testResources>
<testResource>
<!-- Enable variable interpolation in resources -->
@@ -144,6 +151,7 @@
<directory>src/test/resources</directory>
</testResource>
</testResources>
+
<plugins>
<!--
@@ -181,20 +189,6 @@
</executions>
</plugin>
- <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-plugin-processor</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 6f6f2e62e4..884af04ccc 100644
--- a/log4j-parent/pom.xml
+++ b/log4j-parent/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-bom</artifactId>
@@ -1015,6 +1017,7 @@
</build>
<profiles>
+
<profile>
<id>parallel-tests</id>
<build>
@@ -1029,6 +1032,118 @@
</plugins>
</build>
</profile>
+
+ <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>
+
+ <properties>
+ <log4j.docgen.pluginDescriptorsDir.effective>${log4j.docgen.pluginDescriptorsDir.phase2}</log4j.docgen.pluginDescriptorsDir.effective>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <!-- Generate a random target package for `Log4jPlugins.java` -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-plugin-package-for-tests</id>
+ <goals>
+ <goal>bsh-property</goal>
+ </goals>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <properties>
+ <property>log4jPluginPackageForTests</property>
+ </properties>
+ <source><![CDATA[
+ import java.util.Locale;
+ import java.util.Random;
+
+ String groupId = project.getGroupId();
+ String sanitizedArtifactId = project
+ .getArtifactId()
+ .toLowerCase(Locale.US)
+ .replaceFirst("^log4j-", "")
+ .replaceAll("[^a-z]", "_");
+ int salt = new Random(sanitizedArtifactId.hashCode()).nextInt(1000);
+ String log4jPluginPackageForTests = String.format("%s.%s.internal%d", new Object[] {
+ groupId, sanitizedArtifactId, salt
+ });
+ ]]></source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <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.plugin.processor.PluginProcessor` invocation: -->
+ <path>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-plugin-processor</artifactId>
+ <version>${project.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ <compilerArgs combine.children="append">
+ <!-- Provide `org.apache.logging.log4j.docgen.processor.DescriptorGenerator` arguments: -->
+ <arg>-Alog4j.docgen.descriptorFilePath=${log4j.docgen.pluginDescriptorsDir.effective}/${project.artifactId}-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>
+ <arg>-Alog4j.docgen.typeFilter.excludePattern=${log4j.docgen.typeFilter.excludePattern}</arg>
+ </compilerArgs>
+ </configuration>
+
+ <!-- `PluginProcessor` generates a `Log4jPlugins.java` and registers it with `ServiceLoader`.
+ The package of this class is normally auto-computed as the common prefix of all plugin classes.
+ Some modules contain plugins in both `src/main` and `src/test`.
+ Without an additional annotation processor parameter, one class shadows the other one.
+ Hence, we point the one in `src/test` to elsewhere. -->
+ <executions>
+ <execution>
+ <id>default-testCompile</id>
+ <configuration>
+ <compilerArgs combine.children="append">
+ <arg>-ApluginPackage=${log4jPluginPackageForTests}</arg>
+ </compilerArgs>
+ </configuration>
+ </execution>
+ </executions>
+
+ </plugin>
+
+ </plugins>
+ </build>
+
+ </profile>
+
</profiles>
</project>
diff --git a/log4j-plugin-processor/pom.xml b/log4j-plugin-processor/pom.xml
index 4c20538441..26034033aa 100644
--- a/log4j-plugin-processor/pom.xml
+++ b/log4j-plugin-processor/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>
@@ -28,17 +30,23 @@
<packaging>jar</packaging>
<name>Apache Log4j Plugin Processor</name>
<description>Log4j Plugin Annotation Processor</description>
+
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
</properties>
+
<dependencies>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
+
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-plugins</artifactId>
</dependency>
+
</dependencies>
+
</project>
diff --git a/log4j-plugins-test/.log4j-plugin-processing-activator b/log4j-plugins-test/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-plugins-test/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-plugins-test/pom.xml b/log4j-plugins-test/pom.xml
index 6fce895866..765cf1c882 100644
--- a/log4j-plugins-test/pom.xml
+++ b/log4j-plugins-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>
@@ -28,9 +30,11 @@
<packaging>jar</packaging>
<name>Apache Log4j Plugins Test</name>
<description>Log4j Plugin Test Support</description>
+
<properties>
<log4jParentDir>${basedir}/..</log4jParentDir>
</properties>
+
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -68,23 +72,10 @@
<scope>test</scope>
</dependency>
</dependencies>
+
<build>
<plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
@@ -103,6 +94,7 @@
</plugins>
</build>
+
<profiles>
<profile>
<id>parallel-tests</id>
@@ -128,4 +120,5 @@
</build>
</profile>
</profiles>
+
</project>
diff --git a/log4j-script/.log4j-plugin-processing-activator b/log4j-script/.log4j-plugin-processing-activator
new file mode 100644
index 0000000000..ba133f3696
--- /dev/null
+++ b/log4j-script/.log4j-plugin-processing-activator
@@ -0,0 +1 @@
+This file is here to activate the `plugin-processing` Maven profile.
diff --git a/log4j-script/pom.xml b/log4j-script/pom.xml
index a1c00afe19..afb43d3300 100644
--- a/log4j-script/pom.xml
+++ b/log4j-script/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>
@@ -111,21 +113,4 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <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-plugin-processor</artifactId>
- <version>${project.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/log4j-script/src/main/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptCondition.java b/log4j-script/src/main/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptCondition.java
index 373682397d..88006a9c34 100644
--- a/log4j-script/src/main/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptCondition.java
+++ b/log4j-script/src/main/java/org/apache/logging/log4j/script/appender/rolling/action/ScriptCondition.java
@@ -92,8 +92,8 @@ public class ScriptCondition implements ScriptConditional {
* <li>pathList - a {@code java.util.List} containing {@link PathWithAttribute} objects. (The script is
* free to modify and return this list.)</li>
* <li>substitutor - a {@link 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/pom.xml b/pom.xml
index adb5cf93ec..cc52fcf89f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -331,18 +331,25 @@
======================== -->
<!-- `maven-javadoc-plugin` is only used to generate Javadoc HTML used in the website.
We don't deploy any Javadoc JARs.
- We also don't generate Javadoc HTML for all modules, but only for two modules: `log4j-api` and `log4j-core`. -->
- <doclint>all,-missing,-html</doclint>
+ We also don't generate Javadoc HTML for all modules, but only for two modules: `log4j-api` and `log4j-core`.
+ Hence, we disable it by default: -->
<maven.javadoc.skip>true</maven.javadoc.skip>
- <!-- Skipping `maven-site-plugin` globally.
- It is manually enabled only for this root module below. -->
+ <doclint>all,-missing,-html</doclint>
+ <!-- Skipping `maven-site-plugin` globally. -->
<maven.site.skip>true</maven.site.skip>
<maven.site.deploy.skip>true</maven.site.deploy.skip>
- <!-- Temporary override for the `changelog-release` profile introduced by `logging-parent`.
- This override can be removed once `logging-parent` updates `log4j-tools` to version `0.7.0`.
- See https://github.com/apache/logging-log4j-tools/issues/89 -->
- <log4j.changelog.versionPattern><![CDATA[^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>(0|[1-9]\d*)(-[a-zA-Z][0-9a-zA-Z-]*)?)$]]></log4j.changelog.versionPattern>
+ <!-- Dependency versions -->
+ <log4j-docgen.version>0.8.0-SNAPSHOT</log4j-docgen.version>
+
+ <!-- ==================================
+ `log4j-docgen`-specific properties
+ ================================== -->
+ <!-- `log4j-docgen` qualified class name exclude pattern -->
+ <log4j.docgen.typeFilter.excludePattern>^java\..+</log4j.docgen.typeFilter.excludePattern>
+ <!-- Directories where `log4j-docgen` annotation processor will emit files to -->
+ <log4j.docgen.pluginDescriptorsDir.phase1>${maven.multiModuleProjectDirectory}/target/plugin-descriptors/phase1</log4j.docgen.pluginDescriptorsDir.phase1>
+ <log4j.docgen.pluginDescriptorsDir.phase2>${maven.multiModuleProjectDirectory}/target/plugin-descriptors/phase2</log4j.docgen.pluginDescriptorsDir.phase2>
</properties>
@@ -603,6 +610,7 @@
<exclude>**/rabbitmq.config</exclude>
<exclude>**/MANIFEST.MF</exclude>
<exclude>.surefire-*</exclude>
+ <exclude>**/.log4j-*</exclude>
</excludes>
</configuration>
</plugin>
@@ -682,6 +690,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
+
<!-- Copy `src/site/_release-notes` to `src/site/asciidoc/_release-notes`.
This is necessary since `logging-parent` version `<=10.1.1` exports changelogs to `src/site/_release-notes`.
Though `maven-site-plugin` expects them to be at `src/site/asciidoc/_release-notes`.
@@ -703,6 +712,7 @@
</resources>
</configuration>
</execution>
+
<!-- Copy `src/site` to `target/generated-sources/site` -->
<execution>
<id>copy-site</id>
@@ -725,6 +735,7 @@
</resources>
</configuration>
</execution>
+
<!-- Copy `target/site/apidocs` to the parent module's `target/site/javadoc/<artifactId>` folder -->
<execution>
<id>copy-javadoc</id>
@@ -733,10 +744,10 @@
</goals>
<phase>site</phase>
<!-- This execution must be inherited and enabled by modules publishing javadocs: `-api` and `-core`.
- Such modules enable this execution via `javadoc.skip` property.
+ Such modules enable this execution via `maven.javadoc.skip` property.
Hence, don't insert a `<inherited>false</inherited>`, please! -->
<configuration>
- <skip>${javadoc.skip}</skip>
+ <skip>${maven.javadoc.skip}</skip>
<outputDirectory>${maven.multiModuleProjectDirectory}/target/site/javadoc/${project.artifactId}</outputDirectory>
<resources>
<resource>
@@ -744,6 +755,7 @@
</resource>
</resources>
</configuration>
+
</execution>
</executions>
</plugin>
@@ -769,9 +781,95 @@
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-docgen-maven-plugin</artifactId>
+ <version>${log4j-docgen.version}</version>
+ <inherited>false</inherited>
+
+ <!-- Common docgen configuration -->
+ <configuration>
+
+ <!-- Descriptor processing order matters!
+
+ Imagine we place all descriptors to the same folder.
+ Assume that the filesystem walks folder contents in alphanumeric order.
+ Sourcing `log4j-docgen:generate-*` from that folder will consume descriptors in the following order:
+
+ 1. `log4j-1.2.api`
+ 2. `log4j-cassandra`
+ 3. `log4j-core`
+ 4. ...
+
+ For instance, `AbstractFilterable` is defined by the descriptors of both `log4j-cassandra` and `log4j-core`.
+ Due to alphanumeric scanning order, it will appear as it is provided by `log4j-cassandra`.
+ Though, it is actually provided by `log4j-core`.
+ To avoid this problem, we place descriptors to folders associated with phases.
+ We pass the folder of each phase in a certain order to `log4j-docgen:generate-*`. -->
+ <descriptorFileMatchers>
+ <descriptorFileMatcher>
+ <baseDirectory>${log4j.docgen.pluginDescriptorsDir.phase1}</baseDirectory>
+ </descriptorFileMatcher>
+ <descriptorFileMatcher>
+ <baseDirectory>${log4j.docgen.pluginDescriptorsDir.phase2}</baseDirectory>
+ </descriptorFileMatcher>
+ </descriptorFileMatchers>
+
+ <typeFilter>
+ <excludes>
+ <exclude>${log4j.docgen.typeFilter.excludePattern}</exclude>
+ </excludes>
+ </typeFilter>
+
+ </configuration>
+
+ <executions>
+
+ <!-- Generate AsciiDoc from downloaded plugin descriptors -->
+ <execution>
+ <id>generate-plugin-docs</id>
+ <goals>
+ <goal>generate-documentation</goal>
+ </goals>
+ <phase>pre-site</phase>
+ <configuration>
+ <templateDirectory>${project.basedir}/src/docgen-templates</templateDirectory>
+ <indexTemplate>
+ <source>index.adoc.ftl</source>
+ <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/index.adoc</target>
+ </indexTemplate>
+ <typeTemplate>
+ <source>type.adoc.ftl</source>
+ <!-- `target` must be in sync. with the `log4j-docgen-type-template-target` configuration of `log4j-docgen-asciidoctor-extension`! -->
+ <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/%g/%a/%c.adoc</target>
+ </typeTemplate>
+ </configuration>
+ </execution>
+
+ <!-- Generate XSD from downloaded plugin descriptors -->
+ <execution>
+ <id>generate-plugin-schema</id>
+ <goals>
+ <goal>generate-schema</goal>
+ </goals>
+ <phase>pre-site</phase>
+ <configuration>
+ <schemaVersion>${project.version}</schemaVersion>
+ <schemaFile>${project.build.directory}/log4j-config.xsd</schemaFile>
+ </configuration>
+ </execution>
+
+ </executions>
+
+ </plugin>
+
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
+ <!-- `log4j-docgen` uses `asciidoctorj` version `3.x`.
+ Though `asciidoctor-maven-plugin` version `<3.0.0` doesn't work against `asciidoctorj` version `3.x`.
+ Hence, override the `asciidoctor-maven-plugin` version to `3.x`. -->
+ <version>3.0.0</version>
<inherited>false</inherited>
<dependencies>
<dependency>
@@ -779,6 +877,19 @@
<artifactId>spring-asciidoctor-extensions-block-switch</artifactId>
<version>0.6.3</version>
</dependency>
+ <!-- `log4j-docgen` uses `asciidoctorj` version `3.x`.
+ Though `asciidoctor-maven-plugin` version `3.x` still uses `asciidoctorj` version `2.x`.
+ Hence, upgrade the `asciidoctorj` used to version `3.x`. -->
+ <dependency>
+ <groupId>org.asciidoctor</groupId>
+ <artifactId>asciidoctorj</artifactId>
+ <version>3.0.0-alpha.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-docgen-asciidoctor-extension</artifactId>
+ <version>${log4j-docgen.version}</version>
+ </dependency>
</dependencies>
<executions>
<execution>
@@ -798,6 +909,10 @@
<attributes>
<source-highlighter>rouge</source-highlighter>
<toc>left</toc>
+ <log4j-docgen-descriptor-directory>${project.build.directory}/plugin-descriptors</log4j-docgen-descriptor-directory>
+ <log4j-docgen-type-filter-exclude-pattern>${log4j.docgen.typeFilter.excludePattern}</log4j-docgen-type-filter-exclude-pattern>
+ <!-- `log4j-docgen-type-template-target` must be in sync. with the `typeTemplate` configuration of `log4j-docgen-maven-plugin`! -->
+ <log4j-docgen-type-template-target>../../%g/%a/%c.html</log4j-docgen-type-template-target>
</attributes>
</configuration>
</execution>
diff --git a/src/asciidoc/templates/document.html.erb b/src/asciidoc/templates/document.html.erb
index 36d13b0bb8..bd542d7765 100644
--- a/src/asciidoc/templates/document.html.erb
+++ b/src/asciidoc/templates/document.html.erb
@@ -69,6 +69,7 @@
<!-- <li><a href="#">Manual</a></li>-->
<!-- <li><a href="#">Guides</a></li>-->
<li><a href="/legacy-docs.html">Old Docs</a></li>
+ <li><a href="/plugin-reference/index.html">Plugin reference</a></li>
<li><a href="https://cwiki.apache.org/confluence/display/LOGGING/Log4j">Wiki</a></li>
<li><a href="/articles.html">Articles</a></li>
<li><a href="/faq.html">FAQ</a></li>
diff --git a/src/docgen-templates/index.adoc.ftl b/src/docgen-templates/index.adoc.ftl
new file mode 100644
index 0000000000..48e8d0fd3b
--- /dev/null
+++ b/src/docgen-templates/index.adoc.ftl
@@ -0,0 +1,60 @@
+<#ftl output_format="plainText" strip_whitespace=true>
+<#--
+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
+
+https://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.
+-->
+<#-- @ftlvariable name="lookup" type="org.apache.logging.log4j.docgen.generator.TypeLookup" -->
+<#include "license.adoc">
+
+= Plugin reference
+
+This page is a Javadoc-on-steroids specialized for Log4j plugins.
+This reference manual is derived from the source code of all Log4j plugins and types associated with them.
+You can use this reference manual to precisely customize your `log4j2.xml`.
+
+[INFO]
+====
+Every running Log4j system is a constellation of xref:../manual/plugins.adoc[plugins], which is analogous to beans in Java EE and Spring.
+This not only allows Log4j itself to be developed in individual components, but also enables extensibility users can leverage.
+====
+
+[#shortcuts]
+== Shortcuts
+
+* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.config.Configuration.adoc[The `<Configuration>` element assembly in a `log4j2.xml`]
+* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Appender.adoc[The type hierarchy of *appenders*]
+* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Layout.adoc[The type hierarchy of *layouts*]
+* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Filter.adoc[The type hierarchy of *filters*]
+
+[#index]
+== Index
+
+Below is a list of all types reachable by plugins grouped by the Maven coordinate of the artifact bundling them.
+
+<#assign sourcedTypes = lookup?values/>
+<#-- @ftlvariable name="sourcedTypes" type="org.apache.logging.log4j.docgen.generator.ArtifactSourcedType[]" -->
+<#assign lastGroupId = ''/>
+<#assign lastArtifactId = ''/>
+<#list sourcedTypes?sort_by('artifactId', 'groupId', ['type', 'className']) as sourcedType>
+ <#if sourcedType.groupId != lastGroupId || sourcedType.artifactId != lastArtifactId>
+ <#assign lastGroupId = sourcedType.groupId/>
+ <#assign lastArtifactId = sourcedType.artifactId/>
+
+[#${sourcedType.groupId?replace('.', '_')}-${sourcedType.artifactId?replace('.', '_')}]
+=== `${sourcedType.groupId}:${sourcedType.artifactId}`
+
+ </#if>
+* xref:${sourcedType.groupId}/${sourcedType.artifactId}/${sourcedType.type.className}.adoc[`${sourcedType.type.className}`]
+</#list>
diff --git a/src/docgen-templates/license.adoc b/src/docgen-templates/license.adoc
new file mode 100644
index 0000000000..797f7c9fb7
--- /dev/null
+++ b/src/docgen-templates/license.adoc
@@ -0,0 +1,16 @@
+////
+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
+
+ https://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.
+////
diff --git a/src/docgen-templates/type.adoc.ftl b/src/docgen-templates/type.adoc.ftl
new file mode 100644
index 0000000000..3c087e7a96
--- /dev/null
+++ b/src/docgen-templates/type.adoc.ftl
@@ -0,0 +1,146 @@
+<#ftl output_format="plainText" strip_whitespace=true>
+<#--
+ 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
+
+ https://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.
+-->
+<#-- @ftlvariable name="sourcedType" type="org.apache.logging.log4j.docgen.model.ArtifactSourcedType" -->
+<#assign type = sourcedType.type/>
+<#-- @ftlvariable name="type" type="org.apache.logging.log4j.docgen.Type" -->
+<#-- @ftlvariable name="lookup" type="org.apache.logging.log4j.docgen.generator.TypeLookup" -->
+<#include "license.adoc">
+
+[#${type.className?replace('.', '_')}]
+= ${type.name!('`' + type.className + '`')}
+
+Class:: `${type.className}`
+<#if sourcedType.groupId?has_content && sourcedType.artifactId?has_content>
+Provider:: `${sourcedType.groupId}:${sourcedType.artifactId}`
+
+</#if>
+
+${(type.description.text)!}
+
+<#assign hasElements = ((type.elements?size)!0) != 0/>
+<#if type.class.simpleName == 'PluginType'>
+ <#-- @ftlvariable name="type" type="org.apache.logging.log4j.docgen.PluginType" -->
+[#${type.className?replace('.', '_')}-XML-snippet]
+== XML snippet
+[source, xml]
+----
+ <#assign tag><${type.name} </#assign>
+ <#assign indent = tag?replace('.', ' ', 'r')/>
+ <#if !type.attributes?has_content>
+<${type.name}/>
+ <#else>
+ <#list type.attributes?sort_by('name') as attr>
+ <#if attr?is_first>
+${tag}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(hasElements?then('>', '/>'), '')}
+ <#else>
+${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(hasElements?then('>', '/>'), '')}
+ </#if>
+ </#list>
+ <#if hasElements>
+ <#list type.elements as element>
+ <#assign multiplicitySuffix = (element.multiplicity == '*')?then('<!-- multiple occurrences allowed -->','')/>
+ <#assign elementName = 'a-' + element.type?keep_after_last('.') + '-implementation'/>
+ <#if lookup[element.type]??>
+ <#assign element_type = lookup[element.type].type/>
+ <#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.AbstractType" -->
+ <#if element_type.name?? && !element_type.implementations?has_content>
+ <#assign elementName = element_type.name/>
+ </#if>
+ </#if>
+ <${elementName}/>${multiplicitySuffix}
+ </#list>
+</${type.name}>
+ </#if>
+ </#if>
+----
+</#if>
+<#if type.attributes?has_content>
+
+[#${type.className?replace('.', '_')}-attributes]
+== Attributes
+
+Optional attributes are denoted by `?`-suffixed types.
+
+[cols="1m,1m,1m,5"]
+|===
+|Name|Type|Default|Description
+
+ <#list type.attributes?sort_by('name') as attr>
+ <#assign requirementSuffix = attr.required?then('', '?')/>
+|${attr.name}
+ <#assign attrTypeName = attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type)/>
+ <#if lookup[attr.type]??>
+ <#assign attrSourcedType = lookup[attr.type]/>
+|xref:../../${attrSourcedType.groupId}/${attrSourcedType.artifactId}/${attr.type}.adoc[${attrTypeName}]${requirementSuffix}
+ <#else>
+|${attrTypeName}${requirementSuffix}
+ </#if>
+|${attr.defaultValue!}
+a|${(attr.description.text)!}
+
+ </#list>
+|===
+</#if>
+<#if hasElements>
+
+[#${type.className?replace('.', '_')}-components]
+== Nested components
+
+Optional components are denoted by `?`-suffixed types.
+
+[cols="1m,1m,5"]
+|===
+|Tag|Type|Description
+
+ <#list type.elements?sort_by('type') as element>
+ <#assign requirementSuffix = element.required?then('', '?')/>
+ <#assign descriptionCell = (element.description.text)!/>
+ <#assign elementName = element.type?contains('.')?then(element.type?keep_after_last('.'), element.type)/>
+ <#if lookup[element.type]??>
+ <#assign elementSourcedType = lookup[element.type]/>
+ <#assign tagCell = elementSourcedType.type.name!/>
+|${tagCell}
+|xref:../../${elementSourcedType.groupId}/${elementSourcedType.artifactId}/${element.type}.adoc[${elementName}]${requirementSuffix}
+ <#else>
+|
+|${elementName}${requirementSuffix}
+ </#if>
+a|${descriptionCell}
+
+ </#list>
+|===
+</#if>
+<#if type.implementations?has_content>
+
+[#${type.className?replace('.', '_')}-implementations]
+== Known implementations
+
+ <#list type.implementations as impl>
+ <#assign implSourcedType = lookup[impl]/>
+* xref:../../${implSourcedType.groupId}/${implSourcedType.artifactId}/${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}]
+ </#list>
+</#if>
+
+[#shortcuts]
+== Shortcuts
+
+* xref:../../index.adoc[The plugin reference]
+* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.config.Configuration.adoc[The `<Configuration>` element assembly in a `log4j2.xml`]
+* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Appender.adoc[The type hierarchy of *appenders*]
+* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Layout.adoc[The type hierarchy of *layouts*]
+* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Filter.adoc[The type hierarchy of *filters*]