Skip to content

Commit 96486eb

Browse files
committed
Merge remote-tracking branch 'origin/2.x' into release/2.26.0
2 parents 23321de + 8243257 commit 96486eb

11 files changed

Lines changed: 71 additions & 103 deletions

File tree

.github/workflows/build.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,18 @@ permissions: read-all
3030
jobs:
3131

3232
build:
33-
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@rel/12.1.1
34-
secrets:
35-
DV_ACCESS_TOKEN: ${{ startsWith(github.ref_name, 'release/') && '' || secrets.DEVELOCITY_ACCESS_KEY }}
33+
uses: apache/logging-parent/.github/workflows/build-reusable.yaml@gha/v0
3634
with:
3735
java-version: |
3836
8
3937
17
4038
site-enabled: true
4139
reproducibility-check-enabled: false
42-
develocity-enabled: ${{ ! startsWith(github.ref_name, 'release/') }}
4340

4441
deploy-snapshot:
4542
needs: build
4643
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
47-
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@rel/12.1.1
44+
uses: apache/logging-parent/.github/workflows/deploy-snapshot-reusable.yaml@gha/v0
4845
# Secrets for deployments
4946
secrets:
5047
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
@@ -57,7 +54,7 @@ jobs:
5754
deploy-release:
5855
needs: build
5956
if: github.repository == 'apache/logging-log4j2' && startsWith(github.ref_name, 'release/')
60-
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@rel/12.1.1
57+
uses: apache/logging-parent/.github/workflows/deploy-release-reusable.yaml@gha/v0
6158
# Secrets for deployments
6259
secrets:
6360
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
@@ -78,7 +75,7 @@ jobs:
7875
needs: [ deploy-snapshot, deploy-release ]
7976
if: ${{ always() && (needs.deploy-snapshot.result == 'success' || needs.deploy-release.result == 'success') }}
8077
name: "verify-reproducibility (${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.project-version || needs.deploy-snapshot.outputs.project-version }})"
81-
uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@rel/12.1.1
78+
uses: apache/logging-parent/.github/workflows/verify-reproducibility-reusable.yaml@gha/v0
8279
with:
8380
nexus-url: ${{ needs.deploy-release.result == 'success' && needs.deploy-release.outputs.nexus-url || 'https://repository.apache.org/content/groups/snapshots' }}
8481
# Encode the `runs-on` input as JSON array

.github/workflows/codeql-analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ permissions: read-all
3030
jobs:
3131

3232
analyze:
33-
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@rel/12.1.1
33+
uses: apache/logging-parent/.github/workflows/codeql-analysis-reusable.yaml@gha/v0
3434
with:
3535
java-version: |
3636
8

.github/workflows/deploy-site.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
deploy-site-stg:
3535
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x'
36-
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.1
36+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@gha/v0
3737
# Secrets for committing the generated site
3838
secrets:
3939
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
@@ -51,7 +51,7 @@ jobs:
5151

5252
deploy-site-pro:
5353
if: github.repository == 'apache/logging-log4j2' && github.ref_name == '2.x-site-pro'
54-
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.1
54+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@gha/v0
5555
# Secrets for committing the generated site
5656
secrets:
5757
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}
@@ -80,7 +80,7 @@ jobs:
8080
8181
deploy-site-rel:
8282
needs: export-version
83-
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@rel/12.1.1
83+
uses: apache/logging-parent/.github/workflows/deploy-site-reusable.yaml@gha/v0
8484
# Secrets for committing the generated site
8585
secrets:
8686
GPG_SECRET_KEY: ${{ secrets.LOGGING_GPG_SECRET_KEY }}

.github/workflows/develocity-publish-build-scans.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
.vscode
2020
/.metadata/
2121
/.mvn/wrapper/maven-wrapper.jar
22-
/.mvn/.develocity
2322
.flattened-pom.xml
2423
.project
2524
.settings

.mvn/develocity.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@
370370
<log4j.docgen.pluginDescriptorsDir.phase1>${maven.multiModuleProjectDirectory}/target/plugin-descriptors/phase1</log4j.docgen.pluginDescriptorsDir.phase1>
371371
<log4j.docgen.pluginDescriptorsDir.phase2>${maven.multiModuleProjectDirectory}/target/plugin-descriptors/phase2</log4j.docgen.pluginDescriptorsDir.phase2>
372372

373-
<!-- Downgrade temporarily Maven Surefire, since it breaks tests statistics on `develocity.apache.org` -->
374-
<version.maven-surefire>3.2.5</version.maven-surefire>
375373
</properties>
376374

377375
<dependencyManagement>

src/site/antora/modules/ROOT/pages/manual/appenders.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,20 @@ Dynamically choose a different appender for each log event
605605
606606
See xref:manual/appenders/delegating.adoc[] for details.
607607
608+
[#third-party]
609+
== Third-party appenders
610+
611+
[WARNING]
612+
====
613+
These appenders are provided by **third-party** vendors and are not maintained by the link:{logging-services-url}[Apache Logging Services] project.
614+
====
615+
616+
[#more-log4j2-AsyncHttpAppender]
617+
=== Async HTTP appender (`more-log4j2`)
618+
619+
`AsyncHttpAppender` by https://github.com/mlangc/more-log4j2[more-log4j2] batches and optionally compresses log events, before sending them to backends.
620+
This way it is able to deliver high log volumes with little overhead.
621+
608622
[#extending]
609623
== Extending
610624

src/site/antora/modules/ROOT/pages/manual/appenders/delegating.adoc

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,12 @@ xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-loggin
521521
Log4j Core provides three rewrite policies out-of-the-box:
522522
523523
[#MapRewritePolicy]
524-
`MapRewritePolicy`::
525-
+
524+
==== `MapRewritePolicy`
525+
526526
The `MapRewritePolicy` only modifies events that contain a
527527
xref:manual/messages.adoc#MapMessage[`MapMessage`].
528528
It allows adding or updating the keys of the `MapMessage`.
529-
+
529+
530530
[#MapRewritePolicy-attributes]
531531
.`MapRewritePolicy` configuration attributes
532532
[cols="1m,1,1,5"]
@@ -546,7 +546,7 @@ Update::
546546
The rewrite policy will add to the `MapMessage` only entries corresponding to existing keys.
547547
548548
|===
549-
+
549+
550550
[#MapRewritePolicy-elements]
551551
.`MapRewritePolicy` nested elements
552552
[cols="1m,1,4"]
@@ -561,20 +561,20 @@ xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-loggin
561561
A list of map entries to add to the `MapMessage`.
562562
563563
|===
564-
+
564+
565565
xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-MapRewritePolicy[{plugin-reference-marker} Plugin reference for `MapRewritePolicy`]
566566
567567
[#PropertiesRewritePolicy]
568-
`PropertiesRewritePolicy`::
569-
+
568+
==== `PropertiesRewritePolicy`
569+
570570
The `PropertiesRewritePolicy` will add properties to the context data of the log event.
571-
+
571+
572572
[NOTE]
573573
====
574574
Only the context data of the log event will be modified.
575575
The contents of the xref:manual/thread-context.adoc[] will remain unchanged.
576576
====
577-
+
577+
578578
[#PropertiesRewritePolicy-elements]
579579
.`PropertiesRewritePolicy` nested elements
580580
[cols="1m,1,4"]
@@ -591,22 +591,22 @@ xref:manual/configuration.adoc#lazy-property-substitution[runtime property subst
591591
in the
592592
xref:manual/lookups.adoc#global-context[_global context_].
593593
|===
594-
+
594+
595595
xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-PropertiesRewritePolicy[{plugin-reference-marker} Plugin reference for `PropertiesRewritePolicy`]
596596
597597
[#LoggerNameLevelRewritePolicy]
598-
LoggerNameLevelRewritePolicy::
599-
+
598+
==== LoggerNameLevelRewritePolicy
599+
600600
You can use this policy to change the log level of loggers from third-party libraries.
601601
The `LoggerNameLevelRewritePolicy` will rewrite the level of log event for a given logger name prefix.
602-
+
602+
603603
[WARNING]
604604
====
605605
The new log levels will only be used by the filter attached to the `Rewrite` appender and those downstream of the appender.
606606
Filters configured on loggers will use the previous levels.
607607
See xref:manual/filters.adoc[] for more details on filtering
608608
====
609-
+
609+
610610
[#LoggerNameLevelRewritePolicy-attributes]
611611
.`LoggerNameLevelRewritePolicy` configuration attributes
612612
[cols="1m,1,1,5"]
@@ -620,7 +620,7 @@ See xref:manual/filters.adoc[] for more details on filtering
620620
The rewrite policy will only be applied to loggers with this logger name and their children.
621621
622622
|===
623-
+
623+
624624
[#LoggerNameLevelRewritePolicy-elements]
625625
.`LoggerNameLevelRewritePolicy` nested elements
626626
[cols="1m,1,4"]
@@ -633,9 +633,23 @@ The rewrite policy will only be applied to loggers with this logger name and the
633633
Provides a mapping between old level names and new level names.
634634
635635
|===
636-
+
636+
637637
xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-LoggerNameLevelRewritePolicy[{plugin-reference-marker} Plugin reference for `LoggerNameLevelRewritePolicy`]
638638
639+
[#ThirdPartyRewritePolicies]
640+
=== Third Party Rewrite Policies
641+
642+
[WARNING]
643+
====
644+
These `Rewrite Policies` are provided by **third-party** vendors and are not maintained by the https://logging.apache.org/[Apache Logging Services] project.
645+
====
646+
647+
[#MessageRewritePolicy]
648+
==== `MessageRewritePolicy`
649+
650+
The `MessageRewritePolicy` provided by https://github.com/Neel1210/log4j-utils[log4j-utils] allows you to manipulate the text of a log message before it is processed by a downstream appender.
651+
This is particularly useful for defining multiple regex-based replacement rules to mask sensitive information (PII) within the log message as a defensive-in-depth strategy.
652+
639653
[#RewriteAppender-examples]
640654
=== Configuration example
641655

src/site/antora/modules/ROOT/pages/manual/appenders/network.adoc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,23 @@ Additional headers can be configured using the nested
283283
If the appender receives a response with status code different from `2xx`, an exception is thrown.
284284
See also <<HttpAppender-attr-ignoreExceptions,`ignoreExceptions`>> configuration attribute.
285285
286+
[WARNING]
287+
====
288+
Sending logs synchronously, one by one to an HTTP backend is rarely a good idea.
289+
In such a setup, every network or backend-related issue will immediately impact all loggers delegating to the HTTP Appender.
290+
Even when everything is working fine, log statements will block for tens or hundreds of milliseconds in a typical setup.
291+
This is orders of magnitude more than what you get with the xref:manual/appenders.adoc#ConsoleAppender[console appender] and the xref:manual/appenders/file.adoc[file appender].
292+
Also consider the number of HTTP requests and the associated network traffic that can result from such a setup.
293+
294+
Consider at least xref:manual/async.adoc[asynchronous loggers] if you want to use this appender.
295+
Otherwise, please have a look at xref:manual/appenders.adoc#third-party[third-party appenders].
296+
====
297+
286298
[NOTE]
287299
====
288300
The implementation uses
289301
https://docs.oracle.com/javase/{java-target-version}/docs/api/java/net/HttpURLConnection.html[`HttpURLConnection`]
290-
under the hood.
302+
The implementation uses https://docs.oracle.com/javase/{java-target-version}/docs/api/java/net/HttpURLConnection.html[`HttpURLConnection`] under the hood.
291303
====
292304
293305
[#HttpAppender-attributes]

0 commit comments

Comments
 (0)