You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/site/antora/modules/ROOT/pages/manual/appenders.adoc
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -605,6 +605,20 @@ Dynamically choose a different appender for each log event
605
605
606
606
See xref:manual/appenders/delegating.adoc[] for details.
607
607
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.
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`]
566
566
567
567
[#PropertiesRewritePolicy]
568
-
`PropertiesRewritePolicy`::
569
-
+
568
+
==== `PropertiesRewritePolicy`
569
+
570
570
The `PropertiesRewritePolicy` will add properties to the context data of the log event.
571
-
+
571
+
572
572
[NOTE]
573
573
====
574
574
Only the context data of the log event will be modified.
575
575
The contents of the xref:manual/thread-context.adoc[] will remain unchanged.
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`]
596
596
597
597
[#LoggerNameLevelRewritePolicy]
598
-
LoggerNameLevelRewritePolicy::
599
-
+
598
+
==== LoggerNameLevelRewritePolicy
599
+
600
600
You can use this policy to change the log level of loggers from third-party libraries.
601
601
The `LoggerNameLevelRewritePolicy` will rewrite the level of log event for a given logger name prefix.
602
-
+
602
+
603
603
[WARNING]
604
604
====
605
605
The new log levels will only be used by the filter attached to the `Rewrite` appender and those downstream of the appender.
606
606
Filters configured on loggers will use the previous levels.
607
607
See xref:manual/filters.adoc[] for more details on filtering
@@ -620,7 +620,7 @@ See xref:manual/filters.adoc[] for more details on filtering
620
620
The rewrite policy will only be applied to loggers with this logger name and their children.
621
621
622
622
|===
623
-
+
623
+
624
624
[#LoggerNameLevelRewritePolicy-elements]
625
625
.`LoggerNameLevelRewritePolicy` nested elements
626
626
[cols="1m,1,4"]
@@ -633,9 +633,23 @@ The rewrite policy will only be applied to loggers with this logger name and the
633
633
Provides a mapping between old level names and new level names.
634
634
635
635
|===
636
-
+
636
+
637
637
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`]
638
638
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.
Copy file name to clipboardExpand all lines: src/site/antora/modules/ROOT/pages/manual/appenders/network.adoc
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,11 +283,23 @@ Additional headers can be configured using the nested
283
283
If the appender receives a response with status code different from `2xx`, an exception is thrown.
284
284
See also <<HttpAppender-attr-ignoreExceptions,`ignoreExceptions`>> configuration attribute.
285
285
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].
The implementation uses https://docs.oracle.com/javase/{java-target-version}/docs/api/java/net/HttpURLConnection.html[`HttpURLConnection`] under the hood.
0 commit comments