Skip to content

Commit b143700

Browse files
ppkarwaszvy
andauthoredApr 22, 2024··
Port new Download and Installation pages to 2.x (#2487)
Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
1 parent f3819c6 commit b143700

11 files changed

+814
-710
lines changed
 

‎antora-playbook.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,19 @@ ui:
7777
<!-- `@asciidoctor/tabs` extension styles -->
7878
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/tabs.css">
7979
<style>
80+
/* Default `h4` and `h5` are smaller than the normal text, fix header font sizing: */
81+
.doc h1 { font-size: 1.9rem; }
82+
.doc h2 { font-size: 1.7rem; }
83+
.doc h3 { font-size: 1.5rem; font-weight: 400; }
84+
.doc h4 { font-size: 1.3rem; font-weight: 500; }
85+
.doc h5 { font-size: 1.1rem; font-weight: 500; text-decoration: underline; }
86+
/* Tab header fonts aren't rendered good, adjusting the font weight: */
87+
.tablist > ul li { font-weight: 500; }
8088
/* `page-toclevels` greater than 4 are not supported by Antora UI, patching it: */
8189
.toc .toc-menu li[data-level="4"] a {
8290
padding-left: 2.75rem
8391
}
84-
/* Replace the default highlight.js color for strings from red to green: */
92+
/* Replace the default highlight.js color for strings from red (unnecessarily signaling something negative) to green: */
8593
.hljs-string {
8694
color: #0f8532;
8795
}

‎pom.xml

+38
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,13 @@
331331
<!-- Skipping `maven-site-plugin` globally. -->
332332
<maven.site.skip>true</maven.site.skip>
333333
<maven.site.deploy.skip>true</maven.site.deploy.skip>
334+
<site-commons-logging.version>1.3.1</site-commons-logging.version>
335+
<site-jackson.version>2.17.0</site-jackson.version>
334336
<site-log4j-api.version>2.23.1</site-log4j-api.version>
335337
<site-log4j-core.version>2.23.1</site-log4j-core.version>
336338
<site-log4j-layout-template-json.version>2.23.1</site-log4j-layout-template-json.version>
339+
<site-logback.version>1.5.5</site-logback.version>
340+
<site-slf4j.version>2.0.13</site-slf4j.version>
337341

338342
<!-- =====================================================
339343
Direct dependency version properties (in alphabetical order)
@@ -672,21 +676,55 @@
672676
We need these `<dependency>` entries to trick `dependabot` to update the version properties automatically.
673677
No, we cannot use `${project.version}`, because it is not released yet. -->
674678
<dependencies>
679+
680+
<!-- Log4j component dependencies.
681+
No, we cannot use `${project.version}`, because it is not released yet. -->
682+
675683
<dependency>
676684
<groupId>org.apache.logging.log4j</groupId>
677685
<artifactId>log4j-api</artifactId>
678686
<version>${site-log4j-api.version}</version>
679687
</dependency>
688+
680689
<dependency>
681690
<groupId>org.apache.logging.log4j</groupId>
682691
<artifactId>log4j-core</artifactId>
683692
<version>${site-log4j-core.version}</version>
684693
</dependency>
694+
685695
<dependency>
686696
<groupId>org.apache.logging.log4j</groupId>
687697
<artifactId>log4j-layout-template-json</artifactId>
688698
<version>${site-log4j-layout-template-json.version}</version>
689699
</dependency>
700+
701+
<!-- Other dependencies -->
702+
703+
<dependency>
704+
<groupId>commons-logging</groupId>
705+
<artifactId>commons-logging</artifactId>
706+
<version>${site-commons-logging.version}</version>
707+
</dependency>
708+
709+
<dependency>
710+
<groupId>com.fasterxml.jackson</groupId>
711+
<artifactId>jackson-bom</artifactId>
712+
<version>${site-jackson.version}</version>
713+
<type>pom</type>
714+
</dependency>
715+
716+
<dependency>
717+
<groupId>ch.qos.logback</groupId>
718+
<artifactId>logback-core</artifactId>
719+
<version>${site-logback.version}</version>
720+
</dependency>
721+
722+
<dependency>
723+
<groupId>org.slf4j</groupId>
724+
<artifactId>slf4j-api</artifactId>
725+
<version>${site-slf4j.version}</version>
726+
</dependency>
727+
690728
</dependencies>
691729

692730
<executions>

‎src/site/antora/antora.tmpl.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,20 @@ version: ~
3838
start_page: index.adoc
3939
asciidoc:
4040
attributes:
41-
log4j-api-version: "${site-log4j-api.version}"
42-
log4j-core-version: "${site-log4j-core.version}"
43-
log4j-layout-template-json-version: "${site-log4j-layout-template-json.version}"
41+
# Commons
4442
project-github-url: "${scm.url}"
4543
project-name: "Log4j"
4644
project-id: "log4j"
4745
java-target-version: "${maven.compiler.target}"
4846
java-compiler-version: "${minimalJavaBuildVersion}"
47+
logging-services-url: "https://logging.apache.org"
48+
# Dependency versions
49+
commons-logging-version: "${site-commons-logging.version}"
50+
jackson-version: "${site-jackson.version}"
51+
log4j-api-version: "${log4j-api.version}"
52+
log4j-core-version: "${site-log4j-core.version}"
53+
log4j-layout-template-json-version: "${site-log4j-layout-template-json.version}"
54+
logback-version: "${site-logback.version}"
55+
slf4j-version: "${site-slf4j.version}"
4956
nav:
5057
- modules/ROOT/nav.adoc

‎src/site/antora/antora.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,20 @@ version: ~
3838
start_page: index.adoc
3939
asciidoc:
4040
attributes:
41-
log4j-api-version: "1.2.3-api"
42-
log4j-core-version: "1.2.3-core"
43-
log4j-layout-template-json-version: "1.2.3-layout-template-json"
41+
# Commons
4442
project-github-url: "https://github.com/apache/logging-log4j2"
4543
project-name: "Log4j"
4644
project-id: "log4j"
4745
java-target-version: "8"
4846
java-compiler-version: "[17,18)"
47+
logging-services-url: "https://logging.apache.org"
48+
# Dependency versions
49+
commons-logging-version: "1.2.3-commons-logging"
50+
jackson-version: "1.2.3-jackson"
51+
log4j-api-version: "1.2.3-api"
52+
log4j-core-version: "1.2.3-core"
53+
log4j-layout-template-json-version: "1.2.3-layout-template-json"
54+
logback-version: "1.2.3-logback"
55+
slf4j-version: "1.2.3-slf4j"
4956
nav:
5057
- modules/ROOT/nav.adoc

‎src/site/antora/modules/ROOT/nav.adoc

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
* xref:download.adoc[Download]
1919
** xref:runtime-dependencies.adoc[]
2020
** xref:release-notes.adoc[]
21-
* xref:support.adoc[]
22-
** xref:security.adoc[]
21+
* link:{logging-services-url}/support[Support]
22+
** link:{logging-services-url}/security[Security]
2323
** xref:thanks.adoc[Thanks]
2424
2525
.Learn
2626
* xref:manual/index.adoc[]
27+
** xref:manual/installation.adoc[]
2728
** xref:manual/architecture.adoc[]
2829
** xref:manual/migration.adoc[]
2930
** xref:manual/api.adoc[]

‎src/site/antora/modules/ROOT/pages/download.adoc

+4-229
Original file line numberDiff line numberDiff line change
@@ -15,234 +15,9 @@
1515
limitations under the License.
1616
////
1717
18-
= Install Apache Log4j
18+
= Download
1919
20-
Apache Log4j is distributed under the
21-
https://www.apache.org/licenses/LICENSE-2.0.html[Apache License, version 2.0].
20+
You can manually download all published Log4j distributions, verify them, and see their licensing information by following the instructions in {logging-services-url}/download.html[the Download page] of {logging-services-url}[Logging Services].
2221
23-
[#using-a-build-system]
24-
== Using a build system
25-
26-
The preferred way to use Log4j in your project is to use a build system as Maven.
27-
Please add the following to your build systems configuration file `pom.xml` to use Log4j.
28-
29-
Log4j needs two dependencies, since it is separated between the API and the Core.
30-
31-
[tabs%sync]
32-
====
33-
Maven::
34-
+
35-
.`pom.xml` snippet
36-
[source,xml,subs="+attributes"]
37-
----
38-
<dependencies>
39-
<dependency>
40-
<groupId>org.apache.logging.log4j</groupId>
41-
<artifactId>log4j-api</artifactId>
42-
<version>{log4j-api-version}</version>
43-
</dependency>
44-
<dependency>
45-
<groupId>org.apache.logging.log4j</groupId>
46-
<artifactId>log4j-core</artifactId>
47-
<version>{log4j-core-version}</version>
48-
</dependency>
49-
</dependencies>
50-
----
51-
52-
Gradle::
53-
+
54-
.`build.gradle` snippet
55-
[source,subs="+attributes"]
56-
----
57-
compile 'org.apache.logging.log4j:log4j-api:{log4j-api-version}'
58-
compile 'org.apache.logging.log4j:log4j-core:{log4j-core-version}'
59-
----
60-
61-
Ivy::
62-
+
63-
.`ivy.xml` snippet
64-
[source,xml,subs="+attributes"]
65-
----
66-
<dependencies>
67-
<dependency org="org.apache.logging.log4j" name="log4j-api" rev="{log4j-api-version}" />
68-
<dependency org="org.apache.logging.log4j" name="log4j-core" rev="{log4j-core-version}" />
69-
</dependencies>
70-
----
71-
====
72-
73-
== Bill of materials
74-
75-
To keep your Log4j module versions in sync with each other, a BOM (Bill of Material)
76-
pom.xml file is provided for your convenience. To use this with https://maven.apache.org/[Maven],
77-
add the dependency listed below to your `pom.xml` file.
78-
When you specify the version identifier in this section, you don't have to specify the version in your `<dependencies/>` section.
79-
80-
[tabs%sync]
81-
====
82-
Maven::
83-
+
84-
.`pom.xml` snippet
85-
[source,xml,subs="+attributes"]
86-
----
87-
<dependencyManagement>
88-
<dependencies>
89-
<dependency>
90-
<groupId>org.apache.logging.log4j</groupId>
91-
<artifactId>log4j-bom</artifactId>
92-
<version>{log4j-core-version}</version>
93-
<scope>import</scope>
94-
<type>pom</type>
95-
</dependency>
96-
</dependencies>
97-
</dependencyManagement>
98-
----
99-
100-
Gradle::
101-
+
102-
.`build.gradle` snippet
103-
[source,subs="+attributes"]
104-
----
105-
plugins {
106-
id 'io.spring.dependency-management' version '1.0.1.RELEASE' //<1>
107-
}
108-
109-
dependencyManagement {
110-
imports {
111-
mavenBom 'org.apache.logging.log4j:log4j-bom:{log4j-core-version}'
112-
}
113-
}
114-
115-
dependencies {
116-
implementation 'org.apache.logging.log4j:log4j-api'
117-
implementation 'org.apache.logging.log4j:log4j-core'
118-
// etc.
119-
}
120-
----
121-
<1> The additional https://github.com/spring-gradle-plugins/dependency-management-plugin[Gradle plugin] required for dependency management functionality.
122-
====
123-
124-
== Snapshot builds
125-
126-
You can access the latest development snapshot by using the Maven repository
127-
`https://repository.apache.org/snapshots` and the current SNAPSHOT version.
128-
Generally, the master branch will use the next patch version as its snapshot
129-
version regardless of what the next actual version of Log4j will be. For example,
130-
if the latest release were `3.0`, then master would be using the version
131-
`3.0.1-SNAPSHOT`.
132-
133-
To enable snapshots you'll need to enable Snapshots repositories in your build system.
134-
135-
[tabs%sync]
136-
====
137-
Maven::
138-
+
139-
.`pom.xml` snippet
140-
[source,xml,subs="+attributes"]
141-
----
142-
<repositories>
143-
<repository>
144-
<id>apache.snapshots</id>
145-
<name>Apache Snapshot Repository</name>
146-
<url>https://repository.apache.org/snapshots</url>
147-
<releases>
148-
<enabled>false</enabled>
149-
</releases>
150-
</repository>
151-
</repositories>
152-
----
153-
154-
Gradle::
155-
+
156-
.`build.gradle` snippet
157-
[source,subs="+attributes"]
158-
----
159-
repositories {
160-
mavenCentral()
161-
maven { url 'https://repository.apache.org/snapshots' }
162-
}
163-
----
164-
165-
SBT::
166-
+
167-
.`build.sbt` snippet
168-
[source,subs="+attributes"]
169-
----
170-
resolvers += "Apache Snapshot Repository" at "https://repository.apache.org/snapshots"
171-
----
172-
====
173-
174-
== Manual Download
175-
176-
The link in the Mirrors column should display a list of available
177-
mirrors with a default selection based on your inferred location. If you
178-
do not see that page, try a different browser. The checksum and
179-
signature are links to the originals on the main distribution server.
180-
181-
|===
182-
|Distribution |Mirrors |Checksum |Signature
183-
184-
|Apache Log4j binary (tar.gz)
185-
|https://www.apache.org/dyn/closer.lua/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-bin.tar.gz[apache-log4j-{log4j-core-version}-bin.tar.gz]
186-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-bin.tar.gz.sha512[apache-log4j-{log4j-core-version}-bin.tar.gz.sha512]
187-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-bin.tar.gz.asc[apache-log4j-{log4j-core-version}-bin.tar.gz.asc]
188-
189-
|Apache Log4j binary (zip)
190-
|https://www.apache.org/dyn/closer.lua/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-bin.zip[apache-log4j-{log4j-core-version}-bin.zip]
191-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-bin.zip.sha512[apache-log4j-{log4j-core-version}-bin.zip.sha512]
192-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-bin.zip.asc[apache-log4j-{log4j-core-version}-bin.zip.asc]
193-
194-
|Apache Log4j source (tar.gz)
195-
|https://www.apache.org/dyn/closer.lua/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-src.tar.gz[apache-log4j-{log4j-core-version}-src.tar.gz]
196-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-src.tar.gz.sha512[apache-log4j-{log4j-core-version}-src.tar.gz.sha512]
197-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-src.tar.gz.asc[apache-log4j-{log4j-core-version}-src.tar.gz.asc]
198-
199-
|Apache Log4j source (zip)
200-
|https://www.apache.org/dyn/closer.lua/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-src.zip[apache-log4j-{log4j-core-version}-src.zip]
201-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-src.zip.sha512[apache-log4j-{log4j-core-version}-src.zip.sha512]
202-
|https://www.apache.org/dist/logging/log4j/{log4j-core-version}/apache-log4j-{log4j-core-version}-src.zip.asc[apache-log4j-{log4j-core-version}-src.zip.asc]
203-
|===
204-
205-
It is essential that you verify the integrity of the downloaded files
206-
using the PGP or SHA512 signatures. Please read
207-
https://httpd.apache.org/dev/verification.html[Verifying Apache HTTP
208-
Server Releases] for more information on why you should verify our
209-
releases.
210-
211-
The PGP signatures can be verified using PGP or GPG. First download the
212-
https://downloads.apache.org/logging/KEYS[KEYS] as well as the asc
213-
signature file for the relevant distribution. Make sure you get these
214-
files from the https://www.apache.org/dist/logging/[main distribution
215-
directory], rather than from a mirror. Then verify the signatures using
216-
217-
[source,sh,subs=attributes,subs="+attributes"]
218-
----
219-
gpg --import KEYS
220-
gpg --verify apache-log4j-{log4j-core-version}-bin.zip.asc
221-
----
222-
223-
Alternatively, you can verify the SHA512 signature on the files. A unix
224-
program called sha512sum is included in many unix distributions.
225-
226-
[#requirements]
227-
== Requirements
228-
229-
The Apache Log4j runtime requires a minimum of Java 17.
230-
See the http://logging.apache.org/2.x[Log4j 2 website] for the latest releases supporting Java 6, 7, and 8.
231-
232-
== Previous Releases
233-
234-
All previous releases of Apache log4j can be found in the
235-
https://archive.apache.org/dist/logging/log4j/[ASF archive repository]. Of course, all releases are availble for
236-
use as dependencies from the https://search.maven.org/search?q=org.apache.logging.log4j[Maven Central Repository]
237-
238-
== Using Apache Log4j on your classpath
239-
240-
To use Log4j in your application make sure that the API, Plugins, and Core
241-
jars are in the application’s classpath. Add the dependencies listed
242-
below to your classpath.
243-
244-
* log4j-api-{log4j-api-version}.jar
245-
* log4j-plugins-{log4j-core-version}.jar
246-
* log4j-core-{log4j-core-version}.jar
247-
248-
You can do this from the command line or a manifest file.
22+
* Are you looking for **the Log4j installation instructions**? Proceed to xref:manual/installation.adoc[].
23+
* Are you looking for the list of changes associated with a particular release? Proceed to xref:release-notes.adoc[].

‎src/site/antora/modules/ROOT/pages/index.adoc

+27-4
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
2020
Apache Log4j is a versatile, industrial-grade Java logging framework composed of an API, its implementation, and components to assist the deployment for various use cases.
2121
Log4j is https://security.googleblog.com/2021/12/apache-log4j-vulnerability.html[used by 8% of the Maven ecosystem] and listed as one of https://docs.google.com/spreadsheets/d/1ONZ4qeMq8xmeCHX03lIgIYE4MEXVfVL6oj05lbuXTDM/edit#gid=1024997528[the top 100 critical open source software projects].
22-
The project is actively maintained by a link:/team-list.html[team] of several volunteers and xref:support.adoc[support]ed by a big community.
22+
The project is actively maintained by a {logging-services-url}/team-list.html[team] of several volunteers and {logging-services-url}/support[support]ed by a big community.
2323
2424
[#shortcuts]
2525
== Shortcuts
26-
- xref:download.adoc#using-a-build-system[How can I add Log4j artifacts to my Maven/Ivy/Gradle project?]
26+
- xref:manual/installation.adoc[How can I add Log4j artifacts to my Maven/Ivy/Gradle project?]
2727
- xref:manual/usage.adoc[How can I use the Log4j API?]
2828
- xref:manual/configuration.adoc[How can I configure my `log4j2.xml`?]
2929
- xref:release-notes.adoc[Where are the release notes?]
30-
- xref:support.adoc[**I need help!**]
30+
- {logging-services-url}/support[**I need help!**]
3131
3232
[#features]
3333
== Features
@@ -45,7 +45,7 @@ API separation::
4545
The API for Log4j (i.e., `log4j-api`) is separate from the implementation (i.e., `log4j-core`) making it clear for application developers which classes and methods they can use while ensuring forward compatibility.
4646
(See xref:manual/api-separation.adoc[API Separation] for details.)
4747
The Log4j API also provides the most feature rich logging facade in the market; support for various `Message` types (`Object`, `Map`, etc.) besides plain `String`, lambda expressions, parametrized logging, markers, levels, diagnostic contexts (aka. MDC/NDC), etc.
48-
Check out the xref:manual/api.adoc[Java API], link:/log4j/kotlin[Kotlin API], and link:/log4j/scala[Scala API] pages for further information.
48+
Check out the xref:manual/api.adoc[Java API], {logging-services-url}/log4j/kotlin[Kotlin API], and {logging-services-url}/log4j/scala[Scala API] pages for further information.
4949
5050
No vendor lock-in::
5151
Even though the Log4j API is implemented by the Log4j at its fullest, users can choose to use another logging backend.
@@ -60,3 +60,26 @@ Extensibility::
6060
Log4j contains a fully-fledged xref:manual/plugins.adoc[plugin support] that users can leverage to extend its functionality.
6161
You can easily add your own components (layouts, appenders, filters, etc.) or customizing existing ones (e.g., adding new directives to the xref:manual/layouts.adoc#PatternLayout[Pattern] or xref:manual/json-template-layout.adoc#extending[JSON Template Layout]).
6262
Check out the xref:manual/extending.adoc[Extending Log4j] page.
63+
64+
[#requirements]
65+
== Requirements
66+
67+
Log4j 2 runtime requires a minimum of Java 8.
68+
Older versions of Java are supported by previous releases.
69+
70+
[#older-releases]
71+
== Older releases
72+
73+
Are you looking for old versions of Log4j?
74+
While we recommend to always use the latest version, you can find the older versions here:
75+
76+
* {logging-services-url}/1.x/[Log4j 1.x (End of Life, Java 1.4)]
77+
* {logging-services-url}/2.3.x/[Log4j 2.3.x (Java 6)]
78+
* {logging-services-url}/2.12.x/[Log4j 2.12.x (Java 7)]
79+
80+
[#compat]
81+
== Compatibility
82+
83+
The `log4j-1.2-api` module provides compatibility for applications using the Log4j 1 logging methods.
84+
Log4j 2 also provides support for Log4j 1 configuration files.
85+
See xref:manual/migration.adoc#ConfigurationCompatibility[Log4j 2 compatibility with Log4j 1] for more information.

‎src/site/antora/modules/ROOT/pages/manual/installation.adoc

+710
Large diffs are not rendered by default.

‎src/site/antora/modules/ROOT/pages/manual/logsep.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ system property `log4j2.contextSelector` to
9999
create a single LoggerContext using a single configuration that will be
100100
shared across all applications.
101101
2. Place the logging jars in the container's classpath and use the
102-
default ClassLoaderContextSelector. Follow the
103-
xref:manual/webapp.adoc[instructions to initialize Log4j 2 in a web
104-
application]. Each application can be configured to share the same
102+
default ClassLoaderContextSelector.
103+
See the instructions shared in xref:manual/webapp.adoc[Log4j Web].
104+
Each application can be configured to share the same
105105
configuration used at the container or can be individually configured.
106106
If status logging is set to debug in the configuration there will be
107107
output from when logging is initialized in the container and then again

‎src/site/antora/modules/ROOT/pages/security.adoc

-320
This file was deleted.

‎src/site/antora/modules/ROOT/pages/support.adoc

-145
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.