You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gi...@apache.org on 2024/07/08 11:31:00 UTC
(logging-log4j2) branch 2.x-site-stg-out updated: Add website content generated from `a18496567d3463ff1fe47177bfb2f09ac29a9557`
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch 2.x-site-stg-out
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x-site-stg-out by this push:
new 73b15019d9 Add website content generated from `a18496567d3463ff1fe47177bfb2f09ac29a9557`
73b15019d9 is described below
commit 73b15019d9c9389bd4cd6a317fbdcb6c38f39c51
Author: ASF Logging Services RM <pr...@logging.apache.org>
AuthorDate: Mon Jul 8 11:30:54 2024 +0000
Add website content generated from `a18496567d3463ff1fe47177bfb2f09ac29a9557`
---
...ag-0c23746e246efa4a462049e2adc4b0349185aa77.svg | 1 +
...ag-1a68f90761e6350de59d964e3f2cfeb22b591a02.svg | 1 -
...ag-2158b7cc88b372c32a9592f8cdbc1cc926bb8b80.svg | 1 +
...ag-2dc8fe44284ab476198b745bd5308956e31b6352.svg | 1 -
...ag-3f8a04c810525cc09a5e7564abf3aa14ed1f7c81.svg | 1 +
...ag-4d55aeb99a0ae8707b4121b1f76e9544af16b3c4.svg | 1 +
...ag-581e854ee8ecdb00104bac5affda10a653d8f76d.svg | 1 +
...ag-5ffe377615be9b0375b26533bbf7b10507dc946b.svg | 1 +
...ag-63d449f3bcd24cfa522a41f6e2f545416de30322.svg | 1 +
...ag-73365a4d8197b5441a98fd1d661b07760da178be.svg | 1 +
...ag-96b353807a86d1e31f8907713d4f2b7fe5a59ce6.svg | 1 -
...ag-a15d9b3aaacbf863f81fe0dcb0ed21346b6c46ed.svg | 1 +
...ag-ce9936638b62ac5c763a2a3b54dbda70bb0144ff.svg | 1 -
...ag-d0e5615e7f18a6e132c1d6809c9813be92de6923.svg | 1 -
...g-fd71b342bbb89cd55a1ddb592976b9ac26b6348e.svg} | 2 +-
manual/architecture.html | 12 +-
manual/async.html | 2 +-
manual/configuration.html | 23 +-
manual/customloglevels.html | 2 +-
manual/filters.html | 3360 ++++++++++++++------
manual/messages.html | 2 +-
manual/scripts.html | 10 +-
manual/systemproperties.html | 2 +-
plugin-reference.html | 2 +-
sitemap.xml | 116 +-
25 files changed, 2449 insertions(+), 1098 deletions(-)
diff --git a/_images/diag-0c23746e246efa4a462049e2adc4b0349185aa77.svg b/_images/diag-0c23746e246efa4a462049e2adc4b0349185aa77.svg
new file mode 100644
index 0000000000..4c2dd6a5f5
--- /dev/null
+++ b/_images/diag-0c23746e246efa4a462049e2adc4b0349185aa77.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="405px" preserveAspectRatio="none" style="width:390px;height:405px;background:#FFFFFF;" version="1.1" viewBox="0 0 390 405" width="390px" zoomAndPan="magnify"><defs/><g><ellipse cx="210" cy="20" fill="#222222" rx="10" ry="10" style="stroke:#222222;stroke-width:1.0;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" r [...]
\ No newline at end of file
diff --git a/_images/diag-1a68f90761e6350de59d964e3f2cfeb22b591a02.svg b/_images/diag-1a68f90761e6350de59d964e3f2cfeb22b591a02.svg
deleted file mode 100644
index 36ab12457c..0000000000
--- a/_images/diag-1a68f90761e6350de59d964e3f2cfeb22b591a02.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="489px" preserveAspectRatio="none" style="width:917px;height:489px;background:#FFFFFF;" version="1.1" viewBox="0 0 917 489" width="917px" zoomAndPan="magnify"><defs/><g><!--class LoggerContext--><g id="elem_LoggerContext"><rect codeLine="1" fill="#F1F1F1" height="96.8906" id="LoggerContext" rx="2.5" ry="2.5" style=" [...]
\ No newline at end of file
diff --git a/_images/diag-2158b7cc88b372c32a9592f8cdbc1cc926bb8b80.svg b/_images/diag-2158b7cc88b372c32a9592f8cdbc1cc926bb8b80.svg
new file mode 100644
index 0000000000..ebf1b851eb
--- /dev/null
+++ b/_images/diag-2158b7cc88b372c32a9592f8cdbc1cc926bb8b80.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="417px" preserveAspectRatio="none" style="width:442px;height:417px;background:#FFFFFF;" version="1.1" viewBox="0 0 442 417" width="442px" zoomAndPan="magnify"><defs/><g><ellipse cx="215.75" cy="20" fill="#222222" rx="10" ry="10" style="stroke:#222222;stroke-width:1.0;"/><rect fill="none" height="270.3628" style="str [...]
\ No newline at end of file
diff --git a/_images/diag-2dc8fe44284ab476198b745bd5308956e31b6352.svg b/_images/diag-2dc8fe44284ab476198b745bd5308956e31b6352.svg
deleted file mode 100644
index fc48b384db..0000000000
--- a/_images/diag-2dc8fe44284ab476198b745bd5308956e31b6352.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="507px" preserveAspectRatio="none" style="width:649px;height:507px;background:#FFFFFF;" version="1.1" viewBox="0 0 649 507" width="649px" zoomAndPan="magnify"><defs/><g><!--class Configuration--><g id="elem_Configuration"><rect codeLine="1" fill="#F1F1F1" height="129.4844" id="Configuration" rx="2.5" ry="2.5" style= [...]
\ No newline at end of file
diff --git a/_images/diag-3f8a04c810525cc09a5e7564abf3aa14ed1f7c81.svg b/_images/diag-3f8a04c810525cc09a5e7564abf3aa14ed1f7c81.svg
new file mode 100644
index 0000000000..19bc3dd128
--- /dev/null
+++ b/_images/diag-3f8a04c810525cc09a5e7564abf3aa14ed1f7c81.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="1022px" preserveAspectRatio="none" style="width:1327px;height:1022px;background:#FFFFFF;" version="1.1" viewBox="0 0 1327 1022" width="1327px" zoomAndPan="magnify"><defs/><g><!--cluster c--><g id="cluster_c"><path d="M8.5,150.89 L116.5,150.89 A3.75,3.75 0 0 1 119,153.39 L126,173.1869 L806.5,173.1869 A2.5,2.5 0 0 1 [...]
\ No newline at end of file
diff --git a/_images/diag-4d55aeb99a0ae8707b4121b1f76e9544af16b3c4.svg b/_images/diag-4d55aeb99a0ae8707b4121b1f76e9544af16b3c4.svg
new file mode 100644
index 0000000000..230ea88820
--- /dev/null
+++ b/_images/diag-4d55aeb99a0ae8707b4121b1f76e9544af16b3c4.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="424px" preserveAspectRatio="none" style="width:281px;height:424px;background:#FFFFFF;" version="1.1" viewBox="0 0 281 424" width="281px" zoomAndPan="magnify"><defs/><g><ellipse cx="128.5" cy="20" fill="#222222" rx="10" ry="10" style="stroke:#222222;stroke-width:1.0;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" [...]
\ No newline at end of file
diff --git a/_images/diag-581e854ee8ecdb00104bac5affda10a653d8f76d.svg b/_images/diag-581e854ee8ecdb00104bac5affda10a653d8f76d.svg
new file mode 100644
index 0000000000..13bad114d3
--- /dev/null
+++ b/_images/diag-581e854ee8ecdb00104bac5affda10a653d8f76d.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="614px" preserveAspectRatio="none" style="width:551px;height:614px;background:#FFFFFF;" version="1.1" viewBox="0 0 551 614" width="551px" zoomAndPan="magnify"><defs/><g><!--class Configuration--><g id="elem_Configuration"><rect codeLine="1" fill="#F1F1F1" height="129.4844" id="Configuration" rx="2.5" ry="2.5" style= [...]
\ No newline at end of file
diff --git a/_images/diag-5ffe377615be9b0375b26533bbf7b10507dc946b.svg b/_images/diag-5ffe377615be9b0375b26533bbf7b10507dc946b.svg
new file mode 100644
index 0000000000..ea30fa85b9
--- /dev/null
+++ b/_images/diag-5ffe377615be9b0375b26533bbf7b10507dc946b.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="489px" preserveAspectRatio="none" style="width:917px;height:489px;background:#FFFFFF;" version="1.1" viewBox="0 0 917 489" width="917px" zoomAndPan="magnify"><defs/><g><!--class LoggerContext--><g id="elem_LoggerContext"><rect codeLine="1" fill="#F1F1F1" height="96.8906" id="LoggerContext" rx="2.5" ry="2.5" style=" [...]
\ No newline at end of file
diff --git a/_images/diag-63d449f3bcd24cfa522a41f6e2f545416de30322.svg b/_images/diag-63d449f3bcd24cfa522a41f6e2f545416de30322.svg
new file mode 100644
index 0000000000..407cf3e990
--- /dev/null
+++ b/_images/diag-63d449f3bcd24cfa522a41f6e2f545416de30322.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="754px" preserveAspectRatio="none" style="width:549px;height:754px;background:#FFFFFF;" version="1.1" viewBox="0 0 549 754" width="549px" zoomAndPan="magnify"><defs/><g><!--class Configuration--><g id="elem_Configuration"><rect codeLine="1" fill="#F1F1F1" height="129.4844" id="Configuration" rx="2.5" ry="2.5" style= [...]
\ No newline at end of file
diff --git a/_images/diag-73365a4d8197b5441a98fd1d661b07760da178be.svg b/_images/diag-73365a4d8197b5441a98fd1d661b07760da178be.svg
new file mode 100644
index 0000000000..c9b6b7b12e
--- /dev/null
+++ b/_images/diag-73365a4d8197b5441a98fd1d661b07760da178be.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="507px" preserveAspectRatio="none" style="width:649px;height:507px;background:#FFFFFF;" version="1.1" viewBox="0 0 649 507" width="649px" zoomAndPan="magnify"><defs/><g><!--class Configuration--><g id="elem_Configuration"><rect codeLine="1" fill="#F1F1F1" height="129.4844" id="Configuration" rx="2.5" ry="2.5" style= [...]
\ No newline at end of file
diff --git a/_images/diag-96b353807a86d1e31f8907713d4f2b7fe5a59ce6.svg b/_images/diag-96b353807a86d1e31f8907713d4f2b7fe5a59ce6.svg
deleted file mode 100644
index e9ea6a9273..0000000000
--- a/_images/diag-96b353807a86d1e31f8907713d4f2b7fe5a59ce6.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="614px" preserveAspectRatio="none" style="width:551px;height:614px;background:#FFFFFF;" version="1.1" viewBox="0 0 551 614" width="551px" zoomAndPan="magnify"><defs/><g><!--class Configuration--><g id="elem_Configuration"><rect codeLine="1" fill="#F1F1F1" height="129.4844" id="Configuration" rx="2.5" ry="2.5" style= [...]
\ No newline at end of file
diff --git a/_images/diag-a15d9b3aaacbf863f81fe0dcb0ed21346b6c46ed.svg b/_images/diag-a15d9b3aaacbf863f81fe0dcb0ed21346b6c46ed.svg
new file mode 100644
index 0000000000..673dd699c8
--- /dev/null
+++ b/_images/diag-a15d9b3aaacbf863f81fe0dcb0ed21346b6c46ed.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="275px" preserveAspectRatio="none" style="width:281px;height:275px;background:#FFFFFF;" version="1.1" viewBox="0 0 281 275" width="281px" zoomAndPan="magnify"><defs/><g><ellipse cx="137.5" cy="20" fill="#222222" rx="10" ry="10" style="stroke:#222222;stroke-width:1.0;"/><rect fill="#F1F1F1" height="33.9688" rx="12.5" [...]
\ No newline at end of file
diff --git a/_images/diag-ce9936638b62ac5c763a2a3b54dbda70bb0144ff.svg b/_images/diag-ce9936638b62ac5c763a2a3b54dbda70bb0144ff.svg
deleted file mode 100644
index 63ee54500f..0000000000
--- a/_images/diag-ce9936638b62ac5c763a2a3b54dbda70bb0144ff.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="1022px" preserveAspectRatio="none" style="width:1327px;height:1022px;background:#FFFFFF;" version="1.1" viewBox="0 0 1327 1022" width="1327px" zoomAndPan="magnify"><defs/><g><!--cluster c--><g id="cluster_c"><path d="M8.5,150.89 L116.5,150.89 A3.75,3.75 0 0 1 119,153.39 L126,173.1869 L806.5,173.1869 A2.5,2.5 0 0 1 [...]
\ No newline at end of file
diff --git a/_images/diag-d0e5615e7f18a6e132c1d6809c9813be92de6923.svg b/_images/diag-d0e5615e7f18a6e132c1d6809c9813be92de6923.svg
deleted file mode 100644
index 9097a26767..0000000000
--- a/_images/diag-d0e5615e7f18a6e132c1d6809c9813be92de6923.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="754px" preserveAspectRatio="none" style="width:549px;height:754px;background:#FFFFFF;" version="1.1" viewBox="0 0 549 754" width="549px" zoomAndPan="magnify"><defs/><g><!--class Configuration--><g id="elem_Configuration"><rect codeLine="1" fill="#F1F1F1" height="129.4844" id="Configuration" rx="2.5" ry="2.5" style= [...]
\ No newline at end of file
diff --git a/_images/diag-3179a6738d88762b267e7c0bf55d9407cd45c450.svg b/_images/diag-fd71b342bbb89cd55a1ddb592976b9ac26b6348e.svg
similarity index 50%
rename from _images/diag-3179a6738d88762b267e7c0bf55d9407cd45c450.svg
rename to _images/diag-fd71b342bbb89cd55a1ddb592976b9ac26b6348e.svg
index ff62a67ca8..dcd88d33a2 100644
--- a/_images/diag-3179a6738d88762b267e7c0bf55d9407cd45c450.svg
+++ b/_images/diag-fd71b342bbb89cd55a1ddb592976b9ac26b6348e.svg
@@ -1 +1 @@
-<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="300px" preserveAspectRatio="none" style="width:649px;height:300px;background:#FFFFFF;" version="1.1" viewBox="0 0 649 300" width="649px" zoomAndPan="magnify"><defs/><g><!--class LoggerContext--><g id="elem_LoggerContext"><rect codeLine="1" fill="#F1F1F1" height="96.8906" id="LoggerContext" rx="2.5" ry="2.5" style=" [...]
\ No newline at end of file
+<?xml version="1.0" encoding="us-ascii" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="300px" preserveAspectRatio="none" style="width:649px;height:300px;background:#FFFFFF;" version="1.1" viewBox="0 0 649 300" width="649px" zoomAndPan="magnify"><defs/><g><!--class LoggerContext--><g id="elem_LoggerContext"><rect codeLine="1" fill="#F1F1F1" height="96.8906" id="LoggerContext" rx="2.5" ry="2.5" style=" [...]
\ No newline at end of file
diff --git a/manual/architecture.html b/manual/architecture.html
index b6baaceb91..9944900b69 100644
--- a/manual/architecture.html
+++ b/manual/architecture.html
@@ -351,7 +351,7 @@ An overview these major classes can be depicted as follows:</p>
</div>
<div id="architecture-diagram" class="imageblock kroki">
<div class="content">
-<img src="../_images/diag-ce9936638b62ac5c763a2a3b54dbda70bb0144ff.svg" alt="An overview of major classes and their relation">
+<img src="../_images/diag-3f8a04c810525cc09a5e7564abf3aa14ed1f7c81.svg" alt="An overview of major classes and their relation">
</div>
<div class="title">Figure 1. An overview of major classes and their relation</div>
</div>
@@ -395,7 +395,7 @@ It is associated with an active <a href="#Configuration"><code>Configuration</co
</div>
<div id="LoggerContext-diagram" class="imageblock kroki">
<div class="content">
-<img src="../_images/diag-3179a6738d88762b267e7c0bf55d9407cd45c450.svg" alt="`LoggerContext` and other directly related classes">
+<img src="../_images/diag-fd71b342bbb89cd55a1ddb592976b9ac26b6348e.svg" alt="`LoggerContext` and other directly related classes">
</div>
<div class="title">Figure 2. <code>LoggerContext</code> and other directly related classes</div>
</div>
@@ -415,7 +415,7 @@ It models the configuration of all appenders, layouts, filters, loggers, and con
</div>
<div id="Configuration-diagram" class="imageblock kroki">
<div class="content">
-<img src="../_images/diag-1a68f90761e6350de59d964e3f2cfeb22b591a02.svg" alt="`Configuration` and other directly related classes">
+<img src="../_images/diag-5ffe377615be9b0375b26533bbf7b10507dc946b.svg" alt="`Configuration` and other directly related classes">
</div>
<div class="title">Figure 3. <code>Configuration</code> and other directly related classes</div>
</div>
@@ -516,7 +516,7 @@ A <code>LoggerConfig</code> essentially contains</p>
</div>
<div id="LoggerConfig-diagram" class="imageblock kroki">
<div class="content">
-<img src="../_images/diag-2dc8fe44284ab476198b745bd5308956e31b6352.svg" alt="`LoggerConfig` and other directly related classes">
+<img src="../_images/diag-73365a4d8197b5441a98fd1d661b07760da178be.svg" alt="`LoggerConfig` and other directly related classes">
</div>
<div class="title">Figure 6. <code>LoggerConfig</code> and other directly related classes</div>
</div>
@@ -777,7 +777,7 @@ That is, we will examine the effective level of a <code>Logger</code> in various
</div>
<div id="Filter-diagram" class="imageblock kroki">
<div class="content">
-<img src="../_images/diag-96b353807a86d1e31f8907713d4f2b7fe5a59ce6.svg" alt="`Filter` and other directly related classes">
+<img src="../_images/diag-581e854ee8ecdb00104bac5affda10a653d8f76d.svg" alt="`Filter` and other directly related classes">
</div>
<div class="title">Figure 8. <code>Filter</code> and other directly related classes</div>
</div>
@@ -796,7 +796,7 @@ See <a href="appenders.html" class="xref page">Appenders</a> for the complete gu
</div>
<div id="Appender-diagram" class="imageblock kroki">
<div class="content">
-<img src="../_images/diag-d0e5615e7f18a6e132c1d6809c9813be92de6923.svg" alt="`Appender` and other directly related classes">
+<img src="../_images/diag-63d449f3bcd24cfa522a41f6e2f545416de30322.svg" alt="`Appender` and other directly related classes">
</div>
<div class="title">Figure 9. <code>Appender</code> and other directly related classes</div>
</div>
diff --git a/manual/async.html b/manual/async.html
index 44328c3e33..78a0eea5b8 100644
--- a/manual/async.html
+++ b/manual/async.html
@@ -1395,7 +1395,7 @@ to use when the underlying async component cannot keep up with the logging rate
</table>
<div class="paragraph">
<p>Determines the threshold level used by a <code>Discard</code> queue full policy.
-Log events whose level is equal or less specific than the threshold level will be discarded during a queue full event.
+Log events whose level is not more severe than the threshold level will be discarded during a queue full event.
See also <a href="#log4j2.asyncQueueFullPolicy"><code>log4j2.asyncQueueFullPolicy</code></a>.</p>
</div>
</div>
diff --git a/manual/configuration.html b/manual/configuration.html
index b017afb114..74ca51071b 100644
--- a/manual/configuration.html
+++ b/manual/configuration.html
@@ -417,11 +417,14 @@ See <a href="#configuration-factories">Predefined <code>ConfigurationFactory</co
</div>
<div class="paragraph">
<p>If no configuration file is found, Log4j Core uses the <a href="../javadoc/log4j-core/org/apache/logging/log4j/core/config/DefaultConfiguration.html"><code>DefaultConfiguration</code></a> and the <a href="status-logger.html" class="xref page">status logger</a> prints a warning.
-The default configuration prints all messages less specific than <a href="systemproperties.html#log4j2.level" class="xref page"><code>log4j2.level</code></a> to the console.</p>
+The default configuration prints all messages less severe than <a href="systemproperties.html#log4j2.level" class="xref page"><code>log4j2.level</code></a> to the console.</p>
</div>
<div class="paragraph">
-<p>You can override the location of the configuration file using the <a href="systemproperties.html#log4j2.configurationFile" class="xref page">the <code>log4j2.configurationFile</code> system property</a>.
-In such a case, Log4j Core will guess the configuration file format from the provided file name, or use the default configuration factory if the extension is unknown.</p>
+<p>You can override the location of the configuration file
+using the <a href="systemproperties.html#log4j2.configurationFile" class="xref page"><code>log4j2.configurationFile</code>
+system property</a>.
+In such a case, Log4j Core will guess the configuration file format from the provided file name,
+or use the default configuration factory if the extension is unknown.</p>
</div>
<div class="paragraph">
<p>There are certain <strong>best-practices</strong> we strongly recommend you to adapt in your Log4j configuration:</p>
@@ -1142,7 +1145,7 @@ logger.0.appenderRef.0.ref = DEBUG_LOG</code></pre>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>Configures the root logger at level <code>INFO</code> and connects it to the <code>CONSOLE</code> and <code>MAIN</code> appenders.
-The <code>CONSOLE</code> appender will only log messages less specific than <code>WARN</code>.</td>
+The <code>CONSOLE</code> appender will only log messages at least as severe as <code>WARN</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
@@ -1219,6 +1222,10 @@ The logger is configured to forward messages to its parent (the root appender).<
<p>See <a href="customloglevels.html" class="xref page">Custom log level configuration</a> for details.</p>
</div>
</dd>
+</dl>
+</div>
+<div id="global-filters" class="dlist">
+<dl>
<dt class="hdlist1">Filters</dt>
<dd>
<div class="paragraph">
@@ -1673,8 +1680,8 @@ for <code>Logger</code> and <code>AsyncLogger</code>.</p>
</tbody>
</table>
<div class="paragraph">
-<p>Specifies the level threshold that a log event must have to be logged.
-Log events that are more specific than this setting will be filtered out.</p>
+<p>It specifies the level threshold that a log event must have to be logged.
+Log events that are less severe than this setting will be filtered out.</p>
</div>
<div class="paragraph">
<p>See also <a href="filters.html#filters" class="xref page">Filters</a> if you require additional filtering.</p>
@@ -1930,8 +1937,8 @@ logger.1.property.value = Networking</code></pre>
</tbody>
</table>
<div class="paragraph">
-<p>Specifies the level threshold that a log event must have to be logged.
-Log events that are more specific than this setting will be filtered out.</p>
+<p>It specifies the level threshold that a log event must have to be logged.
+Log events that are less severe than this setting will be filtered out.</p>
</div>
</div>
<div class="sect2">
diff --git a/manual/customloglevels.html b/manual/customloglevels.html
index 67c5551bc4..a978c7c285 100644
--- a/manual/customloglevels.html
+++ b/manual/customloglevels.html
@@ -428,7 +428,7 @@ Priority can be used in several contexts to express a filtering capability, for
<p><code>WARN</code> is <em>less severe</em> than <code>ERROR</code></p>
</li>
<li>
-<p><code>WARN</code> is <em>more specific</em> than <code>ERROR</code></p>
+<p><code>WARN</code> is <em>less specific</em> than <code>ERROR</code></p>
</li>
</ul>
</div>
diff --git a/manual/filters.html b/manual/filters.html
index 597b658cf4..7592c48363 100644
--- a/manual/filters.html
+++ b/manual/filters.html
@@ -346,39 +346,287 @@
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
-<p>Log4j supports filtering of log events at each level of the logging pipeline using two features:</p>
+<p>Filters are Log4j plugins that evaluate the parameters of a logging call or a log event and return one of three results:</p>
+</div>
+<div class="dlist">
+<dl>
+<dt class="hdlist1">ACCEPT</dt>
+<dd>
+<p>The filter accepts the log event.
+This effectively causes other filters in the same filtering stage to be skipped.</p>
+</dd>
+<dt class="hdlist1">DENY</dt>
+<dd>
+<p>The filter drops the log event.</p>
+</dd>
+<dt class="hdlist1">NEUTRAL</dt>
+<dd>
+<p>Log4j behaves as if the filter was not present.
+It is evaluated by the next filter in the filter chain.</p>
+</dd>
+</dl>
+</div>
+<div class="paragraph">
+<p>Filters can be used at each level of the
+<a href="architecture.html#architecture-diagram" class="xref page">logging pipeline</a>:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>the global configuration element can contain a <a href="configuration.html#global-filters" class="xref page">global filter</a>.</p>
+</li>
+<li>
+<p>each <a href="configuration.html#configuring-loggers" class="xref page">logger</a> configuration element can contain a <a href="configuration.html#logger-elements-filters" class="xref page">logger filter</a>.</p>
+</li>
+<li>
+<p>each <a href="configuration.html#configuring-appenderrefs" class="xref page">appender reference</a> configuration element can contain an <a href="configuration.html#appenderrefs-elements-filters" class="xref page">appender reference filter</a>.</p>
+</li>
+<li>
+<p>each <a href="appenders.html" class="xref page">appender</a> configuration element can contain an <a href="appenders.html" class="xref page">appender filter</a>.</p>
+</li>
+</ul>
+</div>
+<div class="paragraph">
+<p>Additionally, the following configuration attributes take part in the filtering process:</p>
</div>
<div class="ulist">
<ul>
<li>
-<p>the <code>level</code> attributes that can be set on loggers and appender references,</p>
+<p>the <a href="configuration.html#logger-attributes-level" class="xref page"><code>level</code> attribute</a> of logger configuration elements.</p>
</li>
<li>
-<p>filter components that can be attached to loggers, appenders, appender references or the global configuration object.</p>
+<p>the <a href="configuration.html#appenderref-attributes-level" class="xref page"><code>level</code> attribute</a> of appender reference configuration elements.</p>
</li>
</ul>
</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="filtering-process"><a class="anchor" href="#filtering-process"></a>Filtering process</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Due to the interaction of many elements,
+the filtering process in Log4j is quite complex and can be divided in four stages:</p>
+</div>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p><a href="#logger-stage"><code>Logger</code> stage</a></p>
+</li>
+<li>
+<p><a href="#logger-config-stage"><code>LoggerConfig</code> stage</a></p>
+</li>
+<li>
+<p><a href="#appender-control-stage"><code>AppenderControl</code> stage</a></p>
+</li>
+<li>
+<p><a href="#appender-stage"><code>Appender</code> stage</a></p>
+</li>
+</ol>
+</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>For performance reasons, log events should be filtered at the earliest possible stage.
+This reduces the cost of disabled log events:
+e.g., log event creation, population of context data, formatting, transfer through an asynchronous barrier.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="sect2">
+<h3 id="logger-stage"><a class="anchor" href="#logger-stage"></a>1. <code>Logger</code> stage</h3>
+<div class="imageblock kroki">
+<div class="content">
+<img src="../_images/diag-2158b7cc88b372c32a9592f8cdbc1cc926bb8b80.svg" alt="Diagram">
+</div>
+</div>
<div class="paragraph">
-<p>Filters evaluate the parameters of a logging call (context-wide filter) or a log event and return one of three results:</p>
+<p>The parameters of the logging call are passed to the global filter.
+If the global filter returns:</p>
</div>
<div class="dlist">
<dl>
-<dt class="hdlist1">ACCEPT</dt>
-<dd>
-<p>The log event is accepted by the filter and goes to the next stage of the logging pipeline,</p>
-</dd>
<dt class="hdlist1">DENY</dt>
<dd>
-<p>The log event is unconditionally dropped,</p>
+<p>The log message is immediately discarded.</p>
</dd>
<dt class="hdlist1">NEUTRAL</dt>
<dd>
-<p>Log4j behaves as if the filter was not present.</p>
+<p>If the level of the log message is less severe than the configured logger threshold, the message is discarded.
+Otherwise, a
+<a href="../javadoc/log4j-core/org/apache/logging/log4j/core/LogEvent.html"><code>LogEvent</code></a> is created and processing continues.</p>
+</dd>
+<dt class="hdlist1">ACCEPT</dt>
+<dd>
+<p>A <code>LogEvent</code> is created and processing continues in the next stage.</p>
</dd>
</dl>
</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>This is the only stage, which differentiates between an <code>ACCEPT</code> and <code>NEUTRAL</code> filter result.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>Filtering logging calls at this stage provides the best performance:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>this stage precedes the creation of log events, therefore operations like the
+<a href="thread-context.html" class="xref page">injection of context data</a>,
+<a href="layouts.html#LocationInformation" class="xref page">computation of location information</a>
+will not be performed for disabled log statements.</p>
+</li>
+<li>
+<p>this stage precedes the asynchronous calls performed by either
+<a href="async.html" class="xref page">asynchronous loggers</a>
+or
+<a href="appenders.html#AsyncAppender" class="xref page">asynchronous appenders</a>.</p>
+</li>
+</ul>
+</div>
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="logger-config-stage"><a class="anchor" href="#logger-config-stage"></a>2. <code>LoggerConfig</code> stage</h3>
+<div class="imageblock kroki">
+<div class="content">
+<img src="../_images/diag-4d55aeb99a0ae8707b4121b1f76e9544af16b3c4.svg" alt="Diagram">
+</div>
+</div>
+<div class="paragraph">
+<p>In this stage, log events are evaluated by all the
+<a href="configuration.html#logger-elements-filters" class="xref page">logger filters</a>
+that stand on the path from the logger to an appender.
+Due to the
+<a href="configuration.html#logger-attributes-additivity" class="xref page">additivity of logger configurations</a>,
+this means that a log event must also pass the filters of all the parent loggers,
+until it reaches the logger that references the chosen appender.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="appender-control-stage"><a class="anchor" href="#appender-control-stage"></a>3. <code>AppenderControl</code> stage</h3>
+<div class="imageblock kroki">
+<div class="content">
+<img src="../_images/diag-0c23746e246efa4a462049e2adc4b0349185aa77.svg" alt="Diagram">
+</div>
+</div>
+<div class="paragraph">
+<p>To pass this stage, log events must satisfy both conditions:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>the log event must be at least as severe as the
+<a href="configuration.html#appenderref-attributes-level" class="xref page"><code>level</code> attribute</a>
+of the appender reference.</p>
+</li>
+<li>
+<p>the <a href="configuration.html#appenderrefs-elements-filters" class="xref page">appender reference filter</a> must return <code>ACCEPT</code> or <code>NEUTRAL</code>,</p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect2">
+<h3 id="appender-stage"><a class="anchor" href="#appender-stage"></a>4. <code>Appender</code> stage (optional)</h3>
+<div class="imageblock kroki">
+<div class="content">
+<img src="../_images/diag-a15d9b3aaacbf863f81fe0dcb0ed21346b6c46ed.svg" alt="Diagram">
+</div>
+</div>
+<div class="paragraph">
+<p>If the appender implements
+<a href="../javadoc/log4j-core/org/apache/logging/log4j/core/filter/Filterable.html"><code>Filterable</code></a>
+an additional filtering stage is available.
+When log events reach such an appender,
+the filter attached to an appender is evaluated and if the result is <code>DENY</code>,
+the log event is discarded.</p>
+</div>
+<div class="paragraph">
+<p>All standard appenders implement <code>Filterable</code>.</p>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>Some appenders like the
+<a href="appenders.html#AsyncAppender" class="xref page">asynchronous appender</a>
+use appender references to transfer log events to other appenders.
+In such a case, the filtering process goes back to the <a href="#appender-control-stage"><code>AppenderControl</code> stage</a>.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>Users migrating from Log4j 1 often replace the <code>threshold</code> property of a Log4j 1 appender with a <a href="#ThresholdFilter"><code>ThresholdFilter</code></a> on the equivalent Log4j 2 appender.</p>
+</div>
+<div class="paragraph">
+<p>Using the <code>level</code> property of appender references will give a better performance.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock warning">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-warning" title="Warning"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>Configuring filters at this stage is a measure of last resort,
+since it adds a large overhead to disabled log events.
+You should rather configure the filtering in one of the previous stages.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="example-configuration-file"><a class="anchor" href="#example-configuration-file"></a>Example configuration file</h3>
<div class="paragraph">
-<p>To decide whether a log event from a certain logger is delivered to a specific appender, the following procedure is followed:</p>
+<p>The following example configuration file employs filters at all possible stages to explain their evaluation order:</p>
</div>
<div id="_tabs_1" class="openblock tabs is-sync is-loading">
<div class="content">
@@ -400,127 +648,144 @@
</div>
<div id="_tabs_1_xml--panel" class="tabpanel" aria-labelledby="_tabs_1_xml">
<div class="listingblock">
-<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/filters.xml"><code>log4j2.xml</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><Appenders>
- <Console name="CONSOLE">
- <ThresholdFilter level="WARN"/> <i class="conum" data-value="6"></i><b>(6)</b>
- </Console>
-</Appenders>
-<Loggers>
- <Root level="INFO">
- <ThresholdFilter level="DEBUG"/> <i class="conum" data-value="3"></i><b>(3)</b>
- <AppenderRef ref="CONSOLE" level="WARN"> <i class="conum" data-value="5"></i><b>(5)</b>
- <MarkerFilter marker="ALERT"
- onMatch="NEUTRAL"
- onMismatch="DENY"/> <i class="conum" data-value="4"></i><b>(4)</b>
- </AppenderRef>
- </Root>
- <Logger name="org.example" level="TRACE"> <i class="conum" data-value="2"></i><b>(2)</b>
- <ThresholdFilter level="TRACE"/> <i class="conum" data-value="3"></i><b>(3)</b>
- </Logger>
-</Loggers>
-<MarkerFilter marker="PRIVATE"/> <i class="conum" data-value="1"></i><b>(1)</b></code></pre>
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
+<Configuration xmlns="https://logging.apache.org/xml/ns"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ https://logging.apache.org/xml/ns
+ https://logging.apache.org/xml/ns/log4j-config-2.xsd">
+ <Appenders>
+ <Console name="CONSOLE">
+ <ThresholdFilter level="FATAL"/> <i class="conum" data-value="7"></i><b>(7)</b>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Root level="OFF">
+ <ThresholdFilter level="WARN"/> <i class="conum" data-value="4"></i><b>(4)</b>
+ <AppenderRef ref="CONSOLE" level="ERROR"> <i class="conum" data-value="5"></i><b>(5)</b>
+ <MarkerFilter marker="SECURITY_ALERT"/> <i class="conum" data-value="6"></i><b>(6)</b>
+ </AppenderRef>
+ </Root>
+ <Logger name="org.example" level="DEBUG"> <i class="conum" data-value="2"></i><b>(2)</b>
+ <ThresholdFilter level="INFO"/> <i class="conum" data-value="3"></i><b>(3)</b>
+ </Logger>
+ </Loggers>
+ <MarkerFilter marker="ALERT"
+ onMatch="ACCEPT"
+ onMismatch="NEUTRAL"/> <i class="conum" data-value="1"></i><b>(1)</b>
+</Configuration></code></pre>
</div>
</div>
</div>
<div id="_tabs_1_json--panel" class="tabpanel" aria-labelledby="_tabs_1_json">
<div class="listingblock">
-<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/filters.json"><code>log4j2.json</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json"> "Appenders": {
- "Console": {
- "name": "CONSOLE",
- "ThresholdFilter": {
- "level": "WARN" <i class="conum" data-value="6"></i><b>(6)</b>
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
+ "Configuration": {
+ "Appenders": {
+ "Console": {
+ "name": "CONSOLE",
+ "ThresholdFilter": {
+ "level": "FATAL" <i class="conum" data-value="6"></i><b>(6)</b>
+ }
}
- }
- },
- "Loggers": {
- "Root": {
- "level": "INFO",
- "ThresholdFilter": { <i class="conum" data-value="3"></i><b>(3)</b>
- "level": "DEBUG"
+ },
+ "Loggers": {
+ "Root": {
+ "level": "OFF",
+ "ThresholdFilter": { <i class="conum" data-value="3"></i><b>(3)</b>
+ "level": "WARN"
+ },
+ "AppenderRef": {
+ "ref": "CONSOLE",
+ "level": "ERROR", <i class="conum" data-value="4"></i><b>(4)</b>
+ "MarkerFilter": { <i class="conum" data-value="5"></i><b>(5)</b>
+ "marker": "SECURITY_ALERT"
+ }
+ }
},
- "AppenderRef": {
- "ref": "CONSOLE",
- "level": "WARN", <i class="conum" data-value="5"></i><b>(5)</b>
- "MarkerFilter": { <i class="conum" data-value="4"></i><b>(4)</b>
- "marker": "ALERT",
- "onMatch": "NEUTRAL",
- "onMismatch": "DENY"
+ "Logger": {
+ "name": "org.example",
+ "level": "DEBUG", <i class="conum" data-value="2"></i><b>(2)</b>
+ "ThresholdFilter": { <i class="conum" data-value="3"></i><b>(3)</b>
+ "level": "INFO"
}
}
- },
- "Logger": {
- "name": "org.example",
- "level": "TRACE" <i class="conum" data-value="2"></i><b>(2)</b>
}
+ },
+ "MarkerFilter": { <i class="conum" data-value="1"></i><b>(1)</b>
+ "marker": "ALERT",
+ "onMatch": "ACCEPT",
+ "onMismatch": "NEUTRAL"
}
-},
-"MarkerFilter": { <i class="conum" data-value="1"></i><b>(1)</b>
- "marker": "PRIVATE"
}</code></pre>
</div>
</div>
</div>
<div id="_tabs_1_yaml--panel" class="tabpanel" aria-labelledby="_tabs_1_yaml">
<div class="listingblock">
-<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/filters.yaml"><code>log4j2.yaml</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml"> Appenders:
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">Configuration:
+ Appenders:
Console:
name: "CONSOLE"
- ThresholdFilter: <i class="conum" data-value="6"></i><b>(6)</b>
- level: "WARN"
+ ThresholdFilter: <i class="conum" data-value="7"></i><b>(7)</b>
+ level: "FATAL"
Loggers:
Root:
- level: "INFO"
- ThreadsholdFilter: <i class="conum" data-value="3"></i><b>(3)</b>
- level: "DEBUG"
+ level: "OFF"
+ ThresholdFilter: <i class="conum" data-value="4"></i><b>(4)</b>
+ level: "WARN"
AppenderRef:
ref: "CONSOLE"
- level: "WARN" <i class="conum" data-value="5"></i><b>(5)</b>
- MarkerFilter: <i class="conum" data-value="4"></i><b>(4)</b>
- marker: "ALERT"
- onMatch: "NEUTRAL"
- onMismatch: "DENY"
+ level: "ERROR" <i class="conum" data-value="5"></i><b>(5)</b>
+ MarkerFilter: <i class="conum" data-value="6"></i><b>(6)</b>
+ marker: "SECURITY_ALERT"
Logger:
name: "org.example"
- level: "TRACE" <i class="conum" data-value="2"></i><b>(2)</b>
- ThresholdFilter:
- level: "TRACE" <i class="conum" data-value="3"></i><b>(3)</b>
+ level: "DEBUG" <i class="conum" data-value="2"></i><b>(2)</b>
+ ThresholdFilter: <i class="conum" data-value="3"></i><b>(3)</b>
+ level: "INFO"
MarkerFilter: <i class="conum" data-value="1"></i><b>(1)</b>
- marker: "PRIVATE"</code></pre>
+ marker: "ALERT"
+ onMatch: "ACCEPT"
+ onMismatch: "NEUTRAL"</code></pre>
</div>
</div>
</div>
<div id="_tabs_1_properties--panel" class="tabpanel" aria-labelledby="_tabs_1_properties">
<div class="listingblock">
-<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/filters.properties"><code>log4j2.properties</code></a></div>
<div class="content">
<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">appender.0.type = Console
appender.0.name = CONSOLE
-appender.0.filter.type = ThresholdFilter <i class="conum" data-value="6"></i><b>(6)</b>
-appender.0.filter.level = WARN
+<i class="conum" data-value="7"></i><b>(7)</b>
+appender.0.filter.type = ThresholdFilter
+appender.0.filter.level = FATAL
-rootLogger.level = INFO
-rootLogger.filter.type = ThresholdFilter <i class="conum" data-value="3"></i><b>(3)</b>
-rootLogger.filter.level = DEBUG
+rootLogger.level = OFF
+<i class="conum" data-value="4"></i><b>(4)</b>
+rootLogger.filter.type = ThresholdFilter
+rootLogger.filter.level = WARN
rootLogger.appenderRef.0.ref = CONSOLE
-rootLogger.appenderRef.0.level = WARN <i class="conum" data-value="5"></i><b>(5)</b>
-rootLogger.appenderRef.0.filter.type = MarkerFilter <i class="conum" data-value="4"></i><b>(4)</b>
-rootLogger.appenderRef.0.filter.marker = ALERT
-rootLogger.appenderRef.0.filter.onMatch = NEUTRAL
-rootLogger.appenderRef.0.filter.onMismatch = DENY
+<i class="conum" data-value="5"></i><b>(5)</b>
+rootLogger.appenderRef.0.level = ERROR
+<i class="conum" data-value="6"></i><b>(6)</b>
+rootLogger.appenderRef.0.filter.type = MarkerFilter
+rootLogger.appenderRef.0.filter.marker = SECURITY_ALERT
logger.0.name = org.example
-logger.0.level = DEBUG <i class="conum" data-value="2"></i><b>(2)</b>
-logger.0.filter.type = ThresholdFilter <i class="conum" data-value="3"></i><b>(3)</b>
-logger.0.filter.level = TRACE
+<i class="conum" data-value="2"></i><b>(2)</b>
+logger.0.level = DEBUG
+<i class="conum" data-value="3"></i><b>(3)</b>
+logger.0.filter.type = ThresholdFilter
+logger.0.filter.level = INFO
-filter.type = MarkerFilter <i class="conum" data-value="1"></i><b>(1)</b>
-filter.marker = PRIVATE</code></pre>
+<i class="conum" data-value="1"></i><b>(1)</b>
+filter.0.type = MarkerFilter
+filter.0.marker = ALERT
+filter.0.onMatch = ACCEPT
+filter.0.onMismatch = NEUTRAL</code></pre>
</div>
</div>
</div>
@@ -530,822 +795,2054 @@ filter.marker = PRIVATE</code></pre>
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
-<td>First the context-wide filter is consulted.
-If it returns <code>ACCEPT</code> the log message goes directly to point 3.</td>
+<td>Global filter</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
-<td>Then Log4j checks the message against the configured logger level.</td>
+<td>Logger <code>level</code> attribute. This setting is <strong>ignored</strong> unless the global filter returns <code>NEUTRAL</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
-<td>The filter configured on a logger is applied next.
-If the logger is additive, the filter on the parent logger is applied recursively until we end up on the logger that references the given appender.</td>
+<td>Filter of the <code>org.example</code> logger</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
-<td>Next comes the turn of the filter configured on an appender reference,</td>
+<td>Filter of the root logger (it is the parent of the <code>org.example</code> logger)</td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
-<td>followed by a level check against the configured level of the reference.</td>
+<td>Appender reference <code>level</code> attribute</td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
-<td>The process ends with the filter attached to an appender.</td>
+<td>Filter of the appender reference</td>
</tr>
-</table>
-</div>
-<div class="admonitionblock warning">
-<table>
<tr>
-<td class="icon">
-<i class="fa icon-warning" title="Warning"></i>
-</td>
-<td class="content">
-<div class="paragraph">
-<p>For performance reasons, log events should be filtered as soon as possible in the logging pipeline.
-This reduces the costs (formatting, transfer through an asynchronous barrier) of disabled log events.</p>
-</div>
-</td>
+<td><i class="conum" data-value="7"></i><b>7</b></td>
+<td>Filter of the appender</td>
</tr>
</table>
</div>
-<div class="admonitionblock tip">
-<table>
-<tr>
-<td class="icon">
-<i class="fa icon-tip" title="Tip"></i>
-</td>
-<td class="content">
-<div class="paragraph">
-<p>Users migrating from Log4j 1 often replace the <code>threshold</code> property of a Log4j 1 appender with a <a href="#ThresholdFilter">ThresholdFilter</a> on the equivalent Log4j 2 appender.</p>
-</div>
-<div class="paragraph">
-<p>Using the <code>level</code> property of appender references will give a better performance.</p>
-</div>
-</td>
-</tr>
-</table>
</div>
</div>
</div>
<div class="sect1">
-<h2 id="collection"><a class="anchor" href="#collection"></a>Collection</h2>
+<h2 id="common-configuration"><a class="anchor" href="#common-configuration"></a>Common configuration</h2>
<div class="sectionbody">
+<div class="sect2">
+<h3 id="common-configuration-attributes"><a class="anchor" href="#common-configuration-attributes"></a>Common configuration attributes</h3>
<div class="paragraph">
-<p>Log4j bundles several predefined filters to assist in several common deployment use cases.
-Following sections explain all these in detail.</p>
+<p>The default behavior of filters is in line with the <code>filter()</code> methods of functional interfaces, such as
+<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html#filter-java.util.function.Predicate-"><code>Optional.filter()</code></a>
+or
+<a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#filter-java.util.function.Predicate-"><code>Stream.filter()</code></a>:
+filters pass matching events to the next filter and drop those that do not match.</p>
</div>
-<div class="sect2">
-<h3 id="BurstFilter"><a class="anchor" href="#BurstFilter"></a>BurstFilter</h3>
<div class="paragraph">
-<p>The BurstFilter provides a mechanism to control the rate at which LogEvents are processed by silently discarding events after the maximum limit has been reached.</p>
+<p>To allow for a larger spectrum of behaviors,
+all standard filters, except <code>CompositeFilter</code> and <code>DenyAllFilter</code>, accept the following configuration attributes:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 1. Burst Filter Parameters</caption>
+<caption class="title">Table 1. Common filter configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>level</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Level of messages to be filtered. Anything at or below
-this level will be filtered out if <code>maxBurst</code> has been exceeded. The
-default is WARN meaning any messages that are higher than warn will be
-logged regardless of the size of a burst.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>rate</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">float</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The average number of events per second to allow.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>maxBurst</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">integer</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The maximum number of events that can occur before
-events are filtered for exceeding the average rate. The default is 10
-times the rate.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a id="onMatch"></a>onMatch</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Filter.Result.html"><code>Result</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Filter.Result.html#NEUTRAL"><code>NEUTRAL</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Result returned if the condition matches.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a id="onMismatch"></a>onMismatch</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Filter.Result.html"><code>Result</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Filter.Result.html#DENY"><code>DENY</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Result returned if the condition does not match.</p></td>
</tr>
</tbody>
</table>
-<div class="paragraph">
-<p>A configuration containing the BurstFilter might look like:</p>
-</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
-</div>
-</div>
</div>
<div class="sect2">
-<h3 id="CompositeFilter"><a class="anchor" href="#CompositeFilter"></a>CompositeFilter</h3>
+<h3 id="CompositeFilter"><a class="anchor" href="#CompositeFilter"></a>Composing filters</h3>
<div class="paragraph">
-<p>The CompositeFilter provides a way to specify more than one filter.
-It is added to the configuration as a filter element and contains other filters to be evaluated.
-The filter element accepts no parameters.</p>
+<p>Filters usually test for a single condition.
+To express a more complex filtering logic, Log4j provides a
+<a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-CompositeFilter" class="xref page"><code>Filters</code></a>
+plugin.
+This plugin can contain a sequence of filters and has no other configuration option.</p>
</div>
<div class="paragraph">
-<p>A configuration containing the CompositeFilter might look like:</p>
+<p>The <code>Filters</code> plugin sequentially evaluates each sub-filter and:</p>
</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Filters>
- <MarkerFilter marker="EVENT" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
- <DynamicThresholdFilter key="loginId" defaultThreshold="ERROR"
- onMatch="ACCEPT" onMismatch="NEUTRAL">
- <KeyValuePair key="User1" value="DEBUG"/>
- </DynamicThresholdFilter>
- </Filters>
- <Appenders>
- <File name="Audit" fileName="logs/audit.log">
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- </File>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Logger name="EventLogger" level="info">
- <AppenderRef ref="Audit"/>
- </Logger>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<div class="ulist">
+<ul>
+<li>
+<p>if the sub-filter returns <code>ACCEPT</code> (resp. <code>DENY</code>), the <code>Filters</code> plugin returns <code>ACCEPT</code> (resp. <code>DENY</code>).</p>
+</li>
+<li>
+<p>if the sub-filter return <code>NEUTRAL</code>, the <code>Filters</code> plugin evaluates the next sub-filter in the chain.</p>
+</li>
+<li>
+<p>if the last sub-filter returns <code>NEUTRAL</code>, the <code>Filters</code> plugin returns <code>NEUTRAL</code>.</p>
+</li>
+</ul>
+</div>
+<div class="paragraph">
+<p>The <code>Filters</code> plugin together with the ternary logic of filters, can be used to express most boolean operators.
+In the following examples <code>A</code> and <code>B</code> are two filters.</p>
+</div>
+<div class="dlist">
+<dl>
+<dt class="hdlist1"><code>NOT A</code></dt>
+<dd>
+<p>You can invert the functionality of filter <code>A</code> by swapping the <code>onMatch</code> and <code>onMismatch</code>:</p>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><A onMatch="DENY" onMismatch="NEUTRAL"/></code></pre>
+</div>
+</div>
+</dd>
+<dt class="hdlist1"><code>A AND B</code></dt>
+<dd>
+<p>To select the events that match both <code>A</code> and <code>B</code> you can use:</p>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><Filters>
+ <A/>
+ <B/>
+</Filters></code></pre>
+</div>
+</div>
+</dd>
+<dt class="hdlist1"><code>A OR B</code></dt>
+<dd>
+<p>To select the events that match <code>A</code> or <code>B</code> we can replace <code>NEUTRAL</code> with <code>ACCEPT</code> in the <code>onMatch</code> attribute:</p>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><Filters>
+ <A onMatch="ACCEPT"/>
+ <B onMatch="ACCEPT"/>
+</Filters></code></pre>
+</div>
+</div>
+</dd>
+</dl>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-CompositeFilter" class="xref page">📖 Plugin reference for <code>Filters</code></a></p>
</div>
</div>
</div>
+</div>
+<div class="sect1">
+<h2 id="collection"><a class="anchor" href="#collection"></a>Collection</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Log4j Core provides the following filters out-of-the-box.</p>
+</div>
<div class="sect2">
-<h3 id="DynamicThresholdFilter"><a class="anchor" href="#DynamicThresholdFilter"></a>DynamicThresholdFilter</h3>
+<h3 id="timestamp-filters"><a class="anchor" href="#timestamp-filters"></a>Timestamp filters</h3>
+<div class="paragraph">
+<p>Timestamp filters use the timestamp of log events to decide whether to accept them or not.</p>
+</div>
+<div class="sect3">
+<h4 id="BurstFilter"><a class="anchor" href="#BurstFilter"></a><code>BurstFilter</code></h4>
<div class="paragraph">
-<p>The DynamicThresholdFilter allows filtering by log level based on specific attributes.
-For example, if the user’s loginId is being captured in the ThreadContext Map then it is possible to enable debug logging for only that user.
-If the log event does not contain the specified ThreadContext item NEUTRAL will be returned.</p>
+<p>The <code>BurstFilter</code> limits the rate of log events.
+The rate limit is only applied to log events less severe than a configured log level.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>BurstFilter</code> supports the following parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 2. Dynamic Threshold Filter Parameters</caption>
+<caption class="title">Table 2. <code>BurstFilter</code> — configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>key</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the item in the ThreadContext Map to compare.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>defaultThreshold</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Level of messages to be filtered. The default
-threshold only applies if the log event contains the specified
-ThreadContext Map item and its value do not match any key in the
-key/value pairs.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>keyValuePair</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">KeyValuePair[]</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">One or more KeyValuePair elements that
-define the matching value for the key and the Level to evaluate when the
-key matches.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>level</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html#WARN"><code>WARN</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The rate limit only applies to log events less severe than this level.
+Events at least as severe as this level will always match.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>rate</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>float</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>10</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The average number of events per second to allow.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>maxBurst</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>long</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>10 × rate</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The maximum number of events that can be logged at once, without incurring in rate limiting.</p></td>
</tr>
</tbody>
</table>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
<div class="paragraph">
-<p>Here is a sample configuration containing the DynamicThresholdFilter:</p>
+<p>The <code>BurstFilter</code> uses the <em>sliding window log</em> algorithm with a window <code>window</code> of <code>maxBurst / rate</code> seconds.</p>
</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <DynamicThresholdFilter key="loginId" defaultThreshold="ERROR"
- onMatch="ACCEPT" onMismatch="NEUTRAL">
- <KeyValuePair key="User1" value="DEBUG"/>
- </DynamicThresholdFilter>
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<div class="paragraph">
+<p>The filter maintains a list of recently logged events.
+If in the interval of time of duration <code>window</code> preceding the current log event,
+more than <code>maxBurst</code> events have already been logged, rate limiting is applied.</p>
+</div>
+<div class="paragraph">
+<p>To control the size of the log files only the <code>rate</code> attribute needs to be taken into account.
+The <code>maxBurst</code> attribute controls the temporal spacing between log events:
+lower values of <code>maxBurst</code> will give more evenly spaced log events,
+while higher values will allow for peaks of activity followed by an absence of log events.</p>
+</div>
+</td>
+</tr>
+</table>
</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-BurstFilter" class="xref page">📖 Plugin reference for <code>BurstFilter</code></a></p>
</div>
</div>
-<div class="sect2">
-<h3 id="LevelRangeFilter"><a class="anchor" href="#LevelRangeFilter"></a>LevelRangeFilter</h3>
+<div class="sect3">
+<h4 id="TimeFilter"><a class="anchor" href="#TimeFilter"></a><code>TimeFilter</code></h4>
<div class="paragraph">
-<p><code>LevelRangeFilter</code> allows filtering against a level range, where levels get compared by their associated integral values; <code>OFF</code> has an integral value of 0, <code>FATAL</code> 100, <code>ERROR</code> 200, and so on.</p>
+<p>The <code>TimeFilter</code> only matches log events emitted during a certain time of the day.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>TimeFilter</code> supports the following parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 3. <code>LevelRangeFilter</code> parameters</caption>
+<caption class="title">Table 3. <code>TimeFilter</code> — configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 12.5%;">
+<col style="width: 25%;">
+<col style="width: 12.5%;">
+<col style="width: 50%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>minLevel</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Level</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">the minimum level threshold (defaults to <code>OFF</code>, which has an integral value of 0)</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>maxLevel</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Level</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">the maximum level threshold (defaults to <code>ALL</code>, which has an integral value of <code>Integer.MAX_VALUE</code>)</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>start</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html"><code>LocalTime</code></a> in <code>HH:mm:ss</code> format</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html#MIN"><code>LocalTime.MIN</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The beginning of the time slot.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Filter.Result</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">the result to return on a match, where allowed values are <code>ACCEPT</code>, <code>DENY</code>, or <code>NEUTRAL</code> (default)</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>start</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html"><code>LocalTime</code></a> in <code>HH:mm:ss</code> format</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html#MAX"><code>LocalTime.MAX</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The end of the time slot.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Filter.Result</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">the result to return on a mismatch, where allowed values are <code>ACCEPT</code>, <code>DENY</code> (default), or <code>NEUTRAL</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>timezone</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html"><code>ZoneId</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html#systemDefault--"><code>ZoneId.systemDefault()</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The timezone to use when comparing <code>start</code> and <code>end</code> to the event timestamp.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
-<p>In the following example configuration, a <code>LevelRangeFilter</code> is configured with <code>maxLevel</code> set to <code>INFO</code>.
-The filter will return <code>onMismatch</code> result (i.e., <code>DENY</code>, the default) for log events of level with higher integral values than <code>INFO</code>; i.e., <code>DEBUG</code>, <code>TRACE</code>, etc.</p>
+<p>As a simple application of this filter,
+if you want to forward messages to your console during work hours and to your e-mail account after work hours,
+you can use a configuration snippet like:</p>
</div>
+<div id="_tabs_2" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_2_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_2_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_2_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_2_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
+</div>
+<div id="_tabs_2_xml--panel" class="tabpanel" aria-labelledby="_tabs_2_xml">
<div class="listingblock">
-<div class="title">Example configuration using <code>LevelRangeFilter</code></div>
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/TimeFilter.xml"><code>log4j2.xml</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="WARN" name="MyApp">
- <Appenders>
- <Console name="STDOUT">
- <LevelRangeFilter maxLevel="INFO"/>
- <PatternLayout pattern="%d %p %c{1.} [%t] %m%n"/>
- </Console>
- </Appenders>
- <Loggers>
- <Root level="ERROR">
- <AppenderRef ref="STDOUT"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><AppenderRef ref="CONSOLE">
+ <TimeFilter start="08:00:00" end="16:00:00"/>
+</AppenderRef>
+<AppenderRef ref="SMTP">
+ <TimeFilter start="16:00:00" end="08:00:00"/>
+</AppenderRef></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_2_json--panel" class="tabpanel" aria-labelledby="_tabs_2_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/TimeFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"AppenderRef": [
+ {
+ "ref": "CONSOLE",
+ "TimeFilter": {
+ "start": "08:00:00",
+ "end": "16:00:00"
+ }
+ },
+ {
+ "ref": "SMTP",
+ "TimeFilter": {
+ "start": "16:00:00",
+ "end": "08:00:00"
+ }
+ }
+]</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_2_yaml--panel" class="tabpanel" aria-labelledby="_tabs_2_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/TimeFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">AppenderRef:
+ - ref: "CONSOLE"
+ TimeFilter:
+ start: "08:00:00"
+ end: "16:00:00"
+ - ref: "SMTP"
+ TimeFilter:
+ start: "16:00:00"
+ end: "08:00:00"</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_2_properties--panel" class="tabpanel" aria-labelledby="_tabs_2_properties">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/TimeFilter.properties"><code>log4j2.properties</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">rootLogger.appenderRef.0.ref = CONSOLE
+rootLogger.appenderRef.0.filter.0.type = TimeFilter
+rootLogger.appenderRef.0.filter.0.start = 08:00:00
+rootLogger.appenderRef.0.filter.0.end = 16:00:00
+
+rootLogger.appenderRef.1.ref = SMTP
+rootLogger.appenderRef.1.filter.0.type = TimeFilter
+rootLogger.appenderRef.1.filter.0.start = 16:00:00
+rootLogger.appenderRef.1.filter.0.end = 08:00:00</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-TimeFilter" class="xref page">📖 Plugin reference for <code>TimeFilter</code></a></p>
</div>
</div>
</div>
<div class="sect2">
-<h3 id="MapFilter"><a class="anchor" href="#MapFilter"></a>MapFilter</h3>
+<h3 id="level-filters"><a class="anchor" href="#level-filters"></a>Level filters</h3>
+<div class="paragraph">
+<p>The following filters allow you to filter log events based on their <a href="customloglevels.html" class="xref page">levels</a>.</p>
+</div>
+<div class="sect3">
+<h4 id="LevelMatchFilter"><a class="anchor" href="#LevelMatchFilter"></a><code>LevelMatchFilter</code></h4>
+<div class="paragraph">
+<p>The <code>LevelMatchFilter</code> matches log events that have exactly a certain log level.</p>
+</div>
<div class="paragraph">
-<p>The MapFilter allows filtering against data elements that are in a MapMessage.</p>
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>LevelMatchFilter</code> supports the following parameter:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 4. Map Filter Parameters</caption>
+<caption class="title">Table 4. <code>LevelMatchFilter</code> — configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>keyValuePair</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">KeyValuePair[]</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">One or more KeyValuePair elements that
-define the key in the map and the value to match. If the same key is
-specified more than once then the check for that key will automatically
-be an "or" since a Map can only contain a single value.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">If the operator is "or" then a match by any one of
-the key/value pairs will be considered to be a match, otherwise all the
-key/value pairs must match.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>level</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html#ERROR"><code>ERROR</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The filter only matches log events of this level.</p></td>
</tr>
</tbody>
</table>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
<div class="paragraph">
-<p>As in this configuration, the MapFilter can be used to log particular events:</p>
+<p>If you wish to use a different log file for each log level, you should also use a
+<a href="appenders.html#RoutingAppender" class="xref page"><code>Routing</code> appender</a> together with the
+<a href="lookups.html#EventLookup" class="xref page"><code>${event:Level}</code> lookup</a>.
+Such a solution will ensure that:</p>
</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <MapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
- <KeyValuePair key="eventId" value="Login"/>
- <KeyValuePair key="eventId" value="Logout"/>
- </MapFilter>
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<div class="ulist">
+<ul>
+<li>
+<p>you don’t forget any log level (Log4j supports <a href="customloglevels.html" class="xref page">custom levels</a>).</p>
+</li>
+<li>
+<p>you don’t need to configure an appender for each level separately.</p>
+</li>
+</ul>
</div>
+</td>
+</tr>
+</table>
</div>
<div class="paragraph">
-<p>This sample configuration will exhibit the same behavior as the preceding example since the only logger configured is the root.</p>
-</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <MapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
- <KeyValuePair key="eventId" value="Login"/>
- <KeyValuePair key="eventId" value="Logout"/>
- </MapFilter>
- <AppenderRef ref="RollingFile">
- </AppenderRef>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-LevelMatchFilter" class="xref page">📖 Plugin reference for <code>LevelMatchFilter</code></a></p>
</div>
</div>
+<div class="sect3">
+<h4 id="LevelRangeFilter"><a class="anchor" href="#LevelRangeFilter"></a><code>LevelRangeFilter</code></h4>
<div class="paragraph">
-<p>This third sample configuration will exhibit the same behavior as the preceding examples since the only logger configured is the root and the root is only configured with a single appender reference.</p>
-</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile">
- <MapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
- <KeyValuePair key="eventId" value="Login"/>
- <KeyValuePair key="eventId" value="Logout"/>
- </MapFilter>
- </AppenderRef>
- </Root>
- </Loggers>
-</Configuration></code></pre>
-</div>
-</div>
+<p>The <code>LevelRangeFilter</code> matches log events with a log level within a configured range.</p>
</div>
-<div class="sect2">
-<h3 id="MarkerFilter"><a class="anchor" href="#MarkerFilter"></a>MarkerFilter</h3>
<div class="paragraph">
-<p>The MarkerFilter compares the configured Marker value against the Marker that is included in the LogEvent.
-A match occurs when the Marker name matches either the Log Event’s Marker or one of its parents.</p>
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>LevelRangeFilter</code> supports the following parameter:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 5. Marker Filter Parameters</caption>
+<caption class="title">Table 5. <code>LevelRangeFilter</code> — configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>marker</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the Marker to compare.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>minLevel</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html#OFF"><code>OFF</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The filter only matches log events at most as severe as this level.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>maxLevel</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html#ALL"><code>ALL</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The filter only matches log events at least as severe as this level.</p></td>
</tr>
</tbody>
</table>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
<div class="paragraph">
-<p>A sample configuration that only allows the event to be written by the appender if the Marker matches:</p>
+<p>Make sure not to invert the bounds of the range.
+Starting from the smallest level, <a href="customloglevels.html" class="xref page">the Log4j API defines</a>: <code>OFF</code>, <code>FATAL</code>, <code>ERROR</code>, <code>WARN</code>, <code>INFO</code>, <code>DEBUG</code>, <code>TRACE</code> and <code>ALL</code>.</p>
</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <MarkerFilter marker="FLOW" onMatch="ACCEPT" onMismatch="DENY"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+</td>
+</tr>
+</table>
</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-LevelRangeFilter" class="xref page">📖 Plugin reference for <code>LevelRangeFilter</code></a></p>
</div>
</div>
-<div class="sect2">
-<h3 id="MutableThreadContextMapFilter"><a class="anchor" href="#MutableThreadContextMapFilter"></a>MutableThreadContextMapFilter</h3>
+<div class="sect3">
+<h4 id="ThresholdFilter"><a class="anchor" href="#ThresholdFilter"></a><code>ThresholdFilter</code></h4>
+<div class="paragraph">
+<p>The <code>ThresholdFilter</code> matches log events at least as severe as a configured level.</p>
+</div>
<div class="paragraph">
-<p>The MutableThreadContextMapFilter or MutableContextMapFilter allows filtering against data elements that are in the current context.
-By default, this is the ThreadContext Map.
-The values to compare are defined externally and can be periodically polled for changes.</p>
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>ThresholdFilter</code> supports the following parameter:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 6. Mutable Context Map Filter Parameters</caption>
+<caption class="title">Table 6. <code>ThresholdFilter</code>—configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>configLocation</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">A file path or URI that points to the configuration. See below for a sample configuration.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">If the operator is "or" then a match by any one of
-the key/value pairs will be considered to be a match, otherwise all the
-key/value pairs must match.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pollInterval</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">int</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The number of seconds to wait before checking to see if the configuration has been modified. When using HTTP or HTTPS the server must support the If-Modified-Since header and return a Last-Modified header containing the date and time the file was last modified. Note that by default only the https, file, and jar protocols are allowed. Support for other protocols can be enabled by specifying them in the <code>log4j2.Config [...]
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>level</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html#OFF"><code>OFF</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The filter only matches log events at least as severe as this level.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
-<p>A sample configuration that only allows the event to be written by the appender if the Marker matches:</p>
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ThresholdFilter" class="xref page">📖 Plugin reference for <code>ThresholdFilter</code></a></p>
</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <MutableContextMapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or"
- configLocation="http://localhost:8080/threadContextFilter.json" pollInterval="300"/>
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers></code></pre>
</div>
+<div class="sect3">
+<h4 id="DynamicThresholdFilter"><a class="anchor" href="#DynamicThresholdFilter"></a><code>DynamicThresholdFilter</code></h4>
+<div class="paragraph">
+<p>The <code>DynamicThresholdFilter</code> is a variant of <a href="#ThresholdFilter"><code>ThresholdFilter</code></a>,
+which uses a different threshold for each log event.
+The effective threshold to use is determined by querying the
+<a href="thread-context.html" class="xref page">context data</a>
+of the log event.
+For each log event:</p>
+</div>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>The filter retrieves the value of <code>key</code> in the context data map.</p>
+</li>
+<li>
+<p>The filter checks the list of nested
+<a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair" class="xref page"><code>KeyValuePair</code></a>
+configuration elements to decide which level to apply.</p>
+</li>
+</ol>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>DynamicThresholdFilter</code> supports the following parameters:</p>
</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 7. <code>DynamicThresholdFilter</code>—configuration attributes</caption>
+<colgroup>
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Attribute</th>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>key</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The key to a value in the context map of the log event.</p>
+<p class="tableblock"><strong>Required</strong></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>defaultThreshold</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Level.html#ERROR"><code>ERROR</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Threshold to apply to log events that don’t have a corresponding <code>KeyValuePair</code>.</p></td>
+</tr>
+</tbody>
+</table>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 8. <code>DynamicThresholdFilter</code>—nested elements</caption>
+<colgroup>
+<col style="width: 16.6666%;">
+<col style="width: 16.6666%;">
+<col style="width: 66.6668%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Multiplicity</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair" class="xref page"><code>KeyValuePair</code></a></code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">One or more</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Associates a log level with the context map value associated with <code>key</code>.</p></td>
+</tr>
+</tbody>
+</table>
<div class="paragraph">
-<p>The configuration file supplied to the filter should look similar to:</p>
+<p>For example, if <code>loginId</code> contains the login of the current user,
+you can use this configuration to apply different thresholds to different users:</p>
</div>
+<div id="_tabs_3" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_3_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_3_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_3_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_3_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
+</div>
+<div id="_tabs_3_xml--panel" class="tabpanel" aria-labelledby="_tabs_3_xml">
<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/DynamicThresholdFilter.xml"><code>log4j2.xml</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
- "configs": {
- "loginId": ["rgoers@apache.org", "logging@apache.org"],
- "accountNumber": ["30510263"]
- }
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><DynamicThresholdFilter key="loginId"
+ defaultThreshold="ERROR"> <i class="conum" data-value="3"></i><b>(3)</b>
+ <KeyValuePair key="alice" value="DEBUG"/> <i class="conum" data-value="1"></i><b>(1)</b>
+ <KeyValuePair key="bob" value="INFO"/> <i class="conum" data-value="2"></i><b>(2)</b>
+</DynamicThresholdFilter></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_3_json--panel" class="tabpanel" aria-labelledby="_tabs_3_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/DynamicThresholdFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"DynamicThresholdFilter": {
+ "key": "loginId", <i class="conum" data-value="3"></i><b>(3)</b>
+ "defaultThreshold": "ERROR",
+ "KeyValuePair": [
+ { <i class="conum" data-value="1"></i><b>(1)</b>
+ "key": "alice",
+ "value": "DEBUG"
+ },
+ { <i class="conum" data-value="2"></i><b>(2)</b>
+ "key": "bob",
+ "value": "INFO"
+ }
+ ]
}</code></pre>
</div>
</div>
</div>
+<div id="_tabs_3_yaml--panel" class="tabpanel" aria-labelledby="_tabs_3_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/DynamicThresholdFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">DynamicThresholdFilter:
+ key: "loginId"
+ defaultThreshold: "ERROR" <i class="conum" data-value="3"></i><b>(3)</b>
+ KeyValuePair:
+ - key: "alice" <i class="conum" data-value="1"></i><b>(1)</b>
+ value: "DEBUG"
+ - key: "bob" <i class="conum" data-value="2"></i><b>(2)</b>
+ value: "INFO"</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_3_properties--panel" class="tabpanel" aria-labelledby="_tabs_3_properties">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/DynamicThresholdFilter.properties"><code>log4j2.properties</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">filter.0.type = DynamicThresholdFilter
+filter.0.key = loginId
+<i class="conum" data-value="3"></i><b>(3)</b>
+filter.0.defaultThreshold = ERROR
+<i class="conum" data-value="1"></i><b>(1)</b>
+filter.0.kv0.type = KeyValuePair
+filter.0.kv0.key = alice
+filter.0.kv0.value = DEBUG
+<i class="conum" data-value="2"></i><b>(2)</b>
+filter.0.kv1.type = KeyValuePair
+filter.0.kv1.key = bob
+filter.0.kv1.value = INFO</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="colist arabic">
+<table>
+<tr>
+<td><i class="conum" data-value="1"></i><b>1</b></td>
+<td>If the <code>loginId</code> is <code>alice</code> a threshold level of <code>DEBUG</code> will be used.</td>
+</tr>
+<tr>
+<td><i class="conum" data-value="2"></i><b>2</b></td>
+<td>If the <code>loginId</code> is <code>bob</code> a threshold level of <code>INFO</code> will be used.</td>
+</tr>
+<tr>
+<td><i class="conum" data-value="3"></i><b>3</b></td>
+<td>For all the other values of <code>loginId</code> a threshold level of <code>ERROR</code> will be used.</td>
+</tr>
+</table>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>You can use Log4j Core’s
+<a href="configuration.html#configuration-attribute-monitorInterval" class="xref page">automatic reconfiguration feature</a>
+to modify the <code>KeyValuePair</code>s without restarting your application.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-DynamicThresholdFilter" class="xref page">📖 Plugin reference for <code>DynamicThresholdFilter</code></a></p>
+</div>
+</div>
+</div>
<div class="sect2">
-<h3 id="NoMarkerFilter"><a class="anchor" href="#NoMarkerFilter"></a>NoMarkerFilter</h3>
+<h3 id="marker-filters"><a class="anchor" href="#marker-filters"></a>Marker filters</h3>
+<div class="paragraph">
+<p>The following filters use the
+<a href="markers.html" class="xref page">log event marker</a>
+to filter log events.</p>
+</div>
+<div class="sect3">
+<h4 id="NoMarkerFilter"><a class="anchor" href="#NoMarkerFilter"></a><code>NoMarkerFilter</code></h4>
+<div class="paragraph">
+<p>The <code>NoMarkerFilter</code> matches log events that do not have any markers.</p>
+</div>
+<div class="paragraph">
+<p>This filter does not have any additional configuration attribute,
+except the <a href="#common-configuration-attributes">common configuration attributes</a>.</p>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-NoMarkerFilter" class="xref page">📖 Plugin reference for <code>NoMarkerFilter</code></a></p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="MarkerFilter"><a class="anchor" href="#MarkerFilter"></a><code>MarkerFilter</code></h4>
+<div class="paragraph">
+<p>The <code>MarkerFilter</code> matches log events marked with a specific marker or <strong>any</strong> of its descendants.</p>
+</div>
<div class="paragraph">
-<p>The NoMarkerFilter checks that there is no marker included in the LogEvent.
-A match occurs when there is no marker in the Log Event.</p>
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>MarkerFilter</code> supports the following parameter:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 7. No Marker Filter Parameters</caption>
+<caption class="title">Table 9. <code>MarkerFilter</code>—configuration attributes</caption>
<colgroup>
-<col style="width: 20%;">
-<col style="width: 20%;">
-<col style="width: 60%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>marker</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-api/org/apache/logging/log4j/Marker.html"><code>Marker</code></a></p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The filter only matches log events of marker with the given marker or one of its descendants.</p>
+<p class="tableblock"><strong>Required</strong></p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
-<p>A sample configuration that only allows the event to be written by the appender if no marker is there:</p>
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-MarkerFilter" class="xref page">📖 Plugin reference for <code>MarkerFilter</code></a></p>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="message-filters"><a class="anchor" href="#message-filters"></a>Message filters</h3>
+<div class="paragraph">
+<p>Message filters allow filtering log events based on the
+<a href="messages.html" class="xref page"><code>Message</code></a>
+contained in the log event.</p>
+</div>
+<div class="admonitionblock important">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-important" title="Important"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p><strong>Log messages</strong> are often used interchangeably with <strong>log events</strong>.
+While this simplification holds for several cases, it is not technically correct.
+A log event, capturing the logging context (level, logger name, instant, etc.) along with the log message, is generated by the logging implementation (e.g., Log4j Core) when a user issues a log using a <a href="api.html#loggers" class="xref page">logger</a>, e.g., <code>LOGGER.info("Hello, world!")</code>.
+Hence, <strong>log events are compound objects containing log messages</strong>.</p>
+</div>
+<details>
+<summary class="title">Click for an introduction to log event fields</summary>
+<div class="content">
+<div class="paragraph">
+<p>Log events contain fields that can be classified into three categories:</p>
+</div>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>Some fields are provided explicitly, in a <a href="../javadoc/log4j-api/org/apache/logging/log4j/Logger.html"><code>Logger</code></a> method call.
+The most important are the log level and the log message, which is a description of what happened, and it is addressed to humans.</p>
+</li>
+<li>
+<p>Some fields are contextual (e.g., <a href="thread-context.html" class="xref page">Thread Context</a>) and are either provided explicitly by developers of other parts of the application, or is injected by Java instrumentation.</p>
+</li>
+<li>
+<p>The last category of fields is those that are computed automatically by the logging implementation employed.</p>
+</li>
+</ol>
+</div>
+<div class="paragraph">
+<p>For clarity’s sake let us look at a log event formatted as JSON:</p>
</div>
<div class="listingblock">
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <NoMarkerFilter onMatch="ACCEPT" onMismatch="DENY"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
+ <i class="conum" data-value="1"></i><b>(1)</b>
+ "log.level": "INFO",
+ "message": "Unable to insert data into my_table.",
+ "error.type": "java.lang.RuntimeException",
+ "error.message": null,
+ "error.stack_trace": [
+ {
+ "class": "com.example.Main",
+ "method": "doQuery",
+ "file.name": "Main.java",
+ "file.line": 36
+ },
+ {
+ "class": "com.example.Main",
+ "method": "main",
+ "file.name": "Main.java",
+ "file.line": 25
+ }
+ ],
+ "marker": "SQL",
+ "log.logger": "com.example.Main",
+ <i class="conum" data-value="2"></i><b>(2)</b>
+ "tags": [
+ "SQL query"
+ ],
+ "labels": {
+ "span_id": "3df85580-f001-4fb2-9e6e-3066ed6ddbb1",
+ "trace_id": "1b1f8fc9-1a0c-47b0-a06f-af3c1dd1edf9"
+ },
+ <i class="conum" data-value="3"></i><b>(3)</b>
+ "@timestamp": "2024-05-23T09:32:24.163Z",
+ "log.origin.class": "com.example.Main",
+ "log.origin.method": "doQuery",
+ "log.origin.file.name": "Main.java",
+ "log.origin.file.line": 36,
+ "process.thread.id": 1,
+ "process.thread.name": "main",
+ "process.thread.priority": 5
+}</code></pre>
+</div>
+</div>
+<div class="colist arabic">
+<table>
+<tr>
+<td><i class="conum" data-value="1"></i><b>1</b></td>
+<td>Explicitly supplied fields:
+<div class="dlist">
+<dl>
+<dt class="hdlist1"><code>log.level</code></dt>
+<dd>
+<p>The <a href="customloglevels.html" class="xref page">level</a> of the event, either explicitly provided as an argument to the logger call, or implied by the name of the logger method</p>
+</dd>
+<dt class="hdlist1"><code>message</code></dt>
+<dd>
+<p>The <strong>log message</strong> that describes what happened</p>
+</dd>
+<dt class="hdlist1"><code>error.*</code></dt>
+<dd>
+<p>An <em>optional</em> <code>Throwable</code> explicitly passed as an argument to the logger call</p>
+</dd>
+<dt class="hdlist1"><code>marker</code></dt>
+<dd>
+<p>An <em>optional</em> <a href="markers.html" class="xref page">marker</a> explicitly passed as an argument to the logger call</p>
+</dd>
+<dt class="hdlist1"><code>log.logger</code></dt>
+<dd>
+<p>The <a href="api.html#logger-names" class="xref page">logger name</a> provided explicitly to <code>LogManager.getLogger()</code> or inferred by Log4j API</p>
+</dd>
+</dl>
+</div></td>
+</tr>
+<tr>
+<td><i class="conum" data-value="2"></i><b>2</b></td>
+<td>Contextual fields:
+<div class="dlist">
+<dl>
+<dt class="hdlist1"><code>tags</code></dt>
+<dd>
+<p>The <a href="thread-context.html" class="xref page">Thread Context</a> stack</p>
+</dd>
+<dt class="hdlist1"><code>labels</code></dt>
+<dd>
+<p>The <a href="thread-context.html" class="xref page">Thread Context</a> map</p>
+</dd>
+</dl>
+</div></td>
+</tr>
+<tr>
+<td><i class="conum" data-value="3"></i><b>3</b></td>
+<td>Logging backend specific fields.
+In case you are using Log4j Core, the following fields can be automatically generated:
+<div class="dlist">
+<dl>
+<dt class="hdlist1"><code>@timestamp</code></dt>
+<dd>
+<p>The instant of the logger call</p>
+</dd>
+<dt class="hdlist1"><code>log.origin.*</code></dt>
+<dd>
+<p>The <a href="layouts.html#LocationInformation" class="xref page">location</a> of the logger call in the source code</p>
+</dd>
+<dt class="hdlist1"><code>process.thread.*</code></dt>
+<dd>
+<p>The name of the Java thread, where the logger is called</p>
+</dd>
+</dl>
+</div></td>
+</tr>
+</table>
</div>
</div>
+</details>
+</td>
+</tr>
+</table>
+</div>
+<div class="sect3">
+<h4 id="RegexFilter"><a class="anchor" href="#RegexFilter"></a><code>RegexFilter</code></h4>
+<div class="paragraph">
+<p>The <code>RegexFilter</code> matches a regular expression against either the result of
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/Message.html#getFormat()"><code>Message.getFormat()</code></a>
+or
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/Message.html#getFormat()"><code>Message.getFormattedMessage()</code></a>.
+It can be used with all kinds of <code>Message</code> implementations.</p>
</div>
-<div class="sect2">
-<h3 id="RegexFilter"><a class="anchor" href="#RegexFilter"></a>RegexFilter</h3>
<div class="paragraph">
-<p>The RegexFilter allows the formatted or unformatted message to be compared against a regular expression.</p>
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>RegexFilter</code> supports the following parameters:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 8. Regex Filter Parameters</caption>
+<caption class="title">Table 10. <code>RegexFilter</code> — configuration attributes</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Attribute</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>regex</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The regular expression.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html"><code>Pattern</code></a></p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The regular expression used to match log messages.</p>
+<p class="tableblock"><strong>Required</strong></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>useRawMsg</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">boolean</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">If true the unformatted message will be used,
-otherwise, the formatted message will be used. The default value is
-false.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>boolean</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>false</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">If <code>true</code> the result of
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/Message.html#getFormat()"><code>Message.getFormat()</code></a>
+will be used.
+Otherwise,
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/Message.html#getFormat()"><code>Message.getFormattedMessage()</code></a>
+is used.</p></td>
+</tr>
+</tbody>
+</table>
+<div class="admonitionblock warning">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-warning" title="Warning"></i>
+</td>
+<td class="content">
+<div class="ulist">
+<ul>
+<li>
+<p>This filter only matches if the <strong>whole</strong> log message matches the regular expression.</p>
+</li>
+<li>
+<p>Setting <code>useRawMsg</code> to <code>false</code> decreases performance, since it forces the formatting of all log messages, including the disabled ones.</p>
+</li>
+</ul>
+</div>
+</td>
</tr>
+</table>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-RegexFilter" class="xref page">📖 Plugin reference for <code>RegexFilter</code></a></p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="StringMatchFilter"><a class="anchor" href="#StringMatchFilter"></a><code>StringMatchFilter</code></h4>
+<div class="paragraph">
+<p>The <code>StringMatchFilter</code> matches a log event, if its message contains the given string.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>StringMatchFilter</code> supports the following parameters:</p>
+</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 11. <code>StringMatchFilter</code>—configuration attributes</caption>
+<colgroup>
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
+<th class="tableblock halign-left valign-top">Attribute</th>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
+<th class="tableblock halign-left valign-top">Description</th>
</tr>
+</thead>
+<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The text to look for.</p>
+<p class="tableblock"><strong>Required</strong></p></td>
</tr>
</tbody>
</table>
-<div class="paragraph">
-<p>A sample configuration that only allows the event to be written by the appender if it contains the word "test":</p>
+<div class="admonitionblock warning">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-warning" title="Warning"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>This filter decreases performance, since it forces the formatting of all log messages, including the disabled ones.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-StringMatchFilter" class="xref page">📖 Plugin reference for <code>StringMatchFilter</code></a></p>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="map-filters"><a class="anchor" href="#map-filters"></a>Map filters</h3>
+<div class="paragraph">
+<p>The following filters match log events based on the content of one of these map structures:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>The map contained in a
+<a href="messages.html#MapMessage" class="xref page"><code>MapMessage</code></a> object.
+See
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/MapMessage.html#getData()"><code>MapMessage.getData()</code></a>
+for details.</p>
+</li>
+<li>
+<p>The context data map contained in a
+<a href="../javadoc/log4j-core/org/apache/logging/log4j/core/LogEvent.html"><code>LogEvent</code></a>.
+See
+<a href="../javadoc/log4j-core/org/apache/logging/log4j/core/LogEvent.html#getContextData()"><code>LogEvent.getContextData()</code></a>
+for details.</p>
+</li>
+</ul>
+</div>
+<div class="sect3">
+<h4 id="configuration-map"><a class="anchor" href="#configuration-map"></a>Configuration map</h4>
+<div class="paragraph">
+<p>These filters are configured with a configuration map of type <code>Map<String, String[]></code>,
+which,
+depending on the filter,
+is encoded as either JSON:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
+ "configs": {
+ "clientId": [
+ "1234"
+ ],
+ "userId": [
+ "alice",
+ "bob"
+ ]
+ }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>or as a sequence of
+<a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair" class="xref page"><code>KeyValuePair</code></a>
+plugins:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><KeyValuePair key="clientId" value="1234"/>
+<KeyValuePair key="userId" value="alice"/>
+<KeyValuePair key="userId" value="bob"/></code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The configuration map associates to each key a list of allowed values for that key.
+In the example above the allowed values for the <code>loginId</code> key are either <code>alice</code> or <code>bob</code>.
+The only allowed value for the <code>clientId</code> key is <code>1234</code>.</p>
+</div>
+<div class="paragraph">
+<p>The map filters can work in two matching modes:</p>
+</div>
+<div id="matching-mode-and" class="dlist">
+<dl>
+<dt class="hdlist1">AND</dt>
+<dd>
+<p>A map structure matches
+if the value associated with <strong>each</strong> key
+that appears in the configuration map is one of the allowed values.</p>
+</dd>
+</dl>
+</div>
+<div id="matching-mode-or" class="dlist">
+<dl>
+<dt class="hdlist1">OR</dt>
+<dd>
+<p>A map structure matches
+if the value associated with <strong>at least one</strong> key
+that appears in the configuration map is one of the allowed values.</p>
+</dd>
+</dl>
+</div>
+</div>
+<div class="sect3">
+<h4 id="MapFilter"><a class="anchor" href="#MapFilter"></a><code>MapFilter</code></h4>
+<div class="paragraph">
+<p>The <code>MapFilter</code> allows filtering based on the contents of all
+<a href="messages.html#collection-structured" class="xref page">structured <code>Message</code>s</a>.</p>
+</div>
+<div class="paragraph">
+<p>This filter encodes the <a href="#configuration-map">Configuration map</a> introduced above as a list of
+<code>KeyValuePair</code> elements.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>MapFilter</code> supports the following parameters:</p>
+</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 12. <code>MapFilter</code> — configuration attributes</caption>
+<colgroup>
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Attribute</th>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><em>enumeration</em></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AND</code></p></td>
+<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
+<p>Determines the matching mode of the filter.
+Can be:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p><a href="#matching-mode-and">AND</a></p>
+</li>
+<li>
+<p><a href="#matching-mode-or">OR</a></p>
+</li>
+</ul>
+</div></div></td>
+</tr>
+</tbody>
+</table>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 13. <code>MapFilter</code> — nested elements</caption>
+<colgroup>
+<col style="width: 16.6666%;">
+<col style="width: 16.6666%;">
+<col style="width: 66.6668%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Multiplicity</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair" class="xref page"><code>KeyValuePair</code></a></code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">One or more</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Adds a value as allowed value for a key.
+See <a href="#configuration-map">Configuration map</a> for more details.</p></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>For example,
+if you want to filter all <code>MapMessage</code>s
+that have an <code>eventType</code> key with value <code>authentication</code> <strong>and</strong> an <code>eventId</code> key with value either <code>login</code> <strong>or</strong> <code>logout</code>,
+you can use the following configuration:</p>
+</div>
+<div id="_tabs_4" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_4_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_4_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_4_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_4_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
+</div>
+<div id="_tabs_4_xml--panel" class="tabpanel" aria-labelledby="_tabs_4_xml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MapFilter.xml"><code>log4j2.xml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><MapFilter operator="AND">
+ <KeyValuePair key="eventType" value="authentication"/>
+ <KeyValuePair key="eventId" value="login"/>
+ <KeyValuePair key="eventId" value="logout"/>
+</MapFilter></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_4_json--panel" class="tabpanel" aria-labelledby="_tabs_4_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MapFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"MapFilter": {
+ "operator": "AND",
+ "KeyValuePair": [
+ {
+ "key": "eventType",
+ "value": "authentication"
+ },
+ {
+ "key": "eventId",
+ "value": "login"
+ },
+ {
+ "key": "eventId",
+ "value": "logout"
+ }
+ ]
+}</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_4_yaml--panel" class="tabpanel" aria-labelledby="_tabs_4_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MapFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">MapFilter:
+ operator: "AND"
+ KeyValuePair:
+ - key: "eventType"
+ value: "authentication"
+ - key: "eventId"
+ value: "login"
+ - key: "eventId"
+ value: "logout"</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_4_properties--panel" class="tabpanel" aria-labelledby="_tabs_4_properties">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MapFilter.yaml"><code>log4j2.properties</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">filter.0.type = MapFilter
+filter.0.operator = AND
+
+filter.0.kv0.type = KeyValuePair
+filter.0.kv0.key = eventType
+filter.0.kv0.value = authentication
+
+filter.0.kv1.type = KeyValuePair
+filter.0.kv1.key = eventId
+filter.0.kv1.value = login
+
+filter.0.kv2.type = KeyValuePair
+filter.0.kv2.key = eventId
+filter.0.kv2.value = logout</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>You can use Log4j Core’s
+<a href="configuration.html#configuration-attribute-monitorInterval" class="xref page">automatic reconfiguration feature</a>
+to modify the <code>KeyValuePair</code>s without restarting your application.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-MapFilter" class="xref page">📖 Plugin reference for <code>MapFilter</code></a></p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="StructuredDataFilter"><a class="anchor" href="#StructuredDataFilter"></a><code>StructuredDataFilter</code></h4>
+<div class="paragraph">
+<p>The <code>StructuredDataFilter</code> is a variant of <a href="#MapFilter"><code>MapFilter</code></a> that only matches
+<a href="messages.html#StructuredDataMessage" class="xref page"><code>StructureDataMessage</code></a>s.</p>
+</div>
+<div class="paragraph">
+<p>In addition to matching the map structure contained in a <code>StructuredDataMessage</code>
+(which corresponds to <a href="https://datatracker.ietf.org/doc/html/rfc5424#section-6.3.3">RFC 5424 <code>SD-PARAM</code> elements</a>)
+it provides the following virtual keys:</p>
+</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 14. <code>StructuredDataFilter</code> — virtual keys</caption>
+<colgroup>
+<col style="width: 16.6666%;">
+<col style="width: 16.6666%;">
+<col style="width: 66.6668%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Key</th>
+<th class="tableblock halign-left valign-top">RFC5424 field</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>id</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://datatracker.ietf.org/doc/html/rfc5424#section-6.3.2"><code>SD-ID</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/StructuredDataMessage.html#getId()"><code>id</code> field</a>
+of the <code>StructuredDataMessage</code>.</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>id.name</code></p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/StructuredDataId.html#getName()"><code>name</code> field</a>
+of the <code>StructuredDataId</code> element.</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>type</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.7"><code>MSGID</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/StructuredDataMessage.html#getType()"><code>type</code> field</a>
+of a <code>StructuredDataMessage</code>.</p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>message</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://datatracker.ietf.org/doc/html/rfc5424#section-6.4"><code>MSG</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The result of a
+<a href="../javadoc/log4j-api/org/apache/logging/log4j/message/Message.html#getFormat()"><code>Message.getFormat()</code></a> method call.</p></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>The <code>StructuredDataFilter</code> encodes the <a href="#configuration-map">Configuration map</a> introduced above as a list of
+<code>KeyValuePair</code> and supports the following parameters,
+besides the <a href="#common-configuration-attributes">common configuration attributes</a>:</p>
+</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 15. <code>StructuredDataFilter</code>—configuration attributes</caption>
+<colgroup>
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Attribute</th>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><em>enumeration</em></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AND</code></p></td>
+<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
+<p>Determines the matching mode of the filter.
+Can be:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p><a href="#matching-mode-and">AND</a></p>
+</li>
+<li>
+<p><a href="#matching-mode-or">OR</a></p>
+</li>
+</ul>
+</div></div></td>
+</tr>
+</tbody>
+</table>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 16. <code>StructuredDataFilter</code> — nested elements</caption>
+<colgroup>
+<col style="width: 16.6666%;">
+<col style="width: 16.6666%;">
+<col style="width: 66.6668%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Multiplicity</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair" class="xref page"><code>KeyValuePair</code></a></code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">One or more</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Adds a value as allowed value for a key.
+See <a href="#configuration-map">Configuration map</a> for more details.</p></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>If you want
+to match all log messages with an <code>SD-ID</code> equal to <code>authentication</code> and the value of the <code>userId</code> <code>SD-PARAM</code> equal to either <code>alice</code> or <code>bob</code>,
+you can use the following configuration:</p>
+</div>
+<div id="_tabs_5" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_5_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_5_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_5_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_5_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
+</div>
+<div id="_tabs_5_xml--panel" class="tabpanel" aria-labelledby="_tabs_5_xml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/StructuredDataFilter.xml"><code>log4j2.xml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><StructuredDataFilter operator="AND">
+ <KeyValuePair key="id" value="authentication"/>
+ <KeyValuePair key="userId" value="alice"/>
+ <KeyValuePair key="userId" value="bob"/>
+</StructuredDataFilter></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_5_json--panel" class="tabpanel" aria-labelledby="_tabs_5_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/StructuredDataFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"StructuredDataFilter": {
+ "operator": "AND",
+ "KeyValuePair": [
+ {
+ "key": "id",
+ "value": "authentication"
+ },
+ {
+ "key": "userId",
+ "value": "alice"
+ },
+ {
+ "key": "userId",
+ "value": "bob"
+ }
+ ]
+}</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_5_yaml--panel" class="tabpanel" aria-labelledby="_tabs_5_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/StructuredDataFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">StructuredDataFilter:
+ operator: "AND"
+ KeyValuePair:
+ - key: "id"
+ value: "authentication"
+ - key: "userId"
+ value: "alice"
+ - key: "userId"
+ value: "bob"</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_5_properties--panel" class="tabpanel" aria-labelledby="_tabs_5_properties">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/StructuredDataFilter.yaml"><code>log4j2.properties</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">filter.0.type = StructuredDataFilter
+filter.0.operator = AND
+
+filter.0.kv0.type = KeyValuePair
+filter.0.kv0.key = id
+filter.0.kv0.value = authentication
+
+filter.0.kv1.type = KeyValuePair
+filter.0.kv1.key = userId
+filter.0.kv1.value = alice
+
+filter.0.kv2.type = KeyValuePair
+filter.0.kv2.key = userId
+filter.0.kv2.value = bob</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>You can use Log4j Core’s
+<a href="configuration.html#configuration-attribute-monitorInterval" class="xref page">automatic reconfiguration feature</a>
+to modify the <code>KeyValuePair</code>s without restarting your application.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-StructuredDataFilter" class="xref page">📖 Plugin reference for <code>StructuredDataFilter</code></a></p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="ContextMapFilter"><a class="anchor" href="#ContextMapFilter"></a><code>ContextMapFilter</code></h4>
+<div class="paragraph">
+<p>The <code>ContextMapFilter</code> works in the same way as the <a href="#MapFilter"><code>MapFilter</code></a> above,
+except it checks the
+<a href="thread-context.html" class="xref page">context map data</a>
+of the log event instead of the log message.</p>
+</div>
+<div class="paragraph">
+<p>This filter also encodes the <a href="#configuration-map">Configuration map</a> introduced above as a list of
+<code>KeyValuePair</code> elements.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>ContextMapFilter</code> supports the following parameters:</p>
+</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 17. <code>ContextMapFilter</code> — configuration attributes</caption>
+<colgroup>
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Attribute</th>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><em>enumeration</em></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>AND</code></p></td>
+<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
+<p>Determines the matching mode of the filter.
+Can be:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p><a href="#matching-mode-and">AND</a></p>
+</li>
+<li>
+<p><a href="#matching-mode-or">OR</a></p>
+</li>
+</ul>
+</div></div></td>
+</tr>
+</tbody>
+</table>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 18. <code>ContextMapFilter</code> — nested elements</caption>
+<colgroup>
+<col style="width: 16.6666%;">
+<col style="width: 16.6666%;">
+<col style="width: 66.6668%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Multiplicity</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair" class="xref page"><code>KeyValuePair</code></a></code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">One or more</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Adds a value as allowed value for a key.
+See <a href="#configuration-map">Configuration map</a> for more details.</p></td>
+</tr>
+</tbody>
+</table>
+<div class="paragraph">
+<p>For example,
+if the <code>clientId</code> and <code>userId</code> keys in the context data map identify your client and his end users,
+you can filter the log events generated by users <code>alice</code> and <code>bob</code> of client <code>1234</code> using this configuration:</p>
+</div>
+<div id="_tabs_6" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_6_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_6_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_6_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_6_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
+</div>
+<div id="_tabs_6_xml--panel" class="tabpanel" aria-labelledby="_tabs_6_xml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ContextMapFilter.xml"><code>log4j2.xml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><ContextMapFilter operator="AND">
+ <KeyValuePair key="clientId" value="1234"/>
+ <KeyValuePair key="userId" value="alice"/>
+ <KeyValuePair key="userId" value="bob"/>
+</ContextMapFilter></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_6_json--panel" class="tabpanel" aria-labelledby="_tabs_6_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ContextMapFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"ContextMapFilter": {
+ "operator": "AND",
+ "KeyValuePair": [
+ {
+ "key": "clientId",
+ "value": "1234"
+ },
+ {
+ "key": "userId",
+ "value": "alice"
+ },
+ {
+ "key": "userId",
+ "value": "bob"
+ }
+ ]
+}</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_6_yaml--panel" class="tabpanel" aria-labelledby="_tabs_6_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ContextMapFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">ContextMapFilter:
+ operator: "AND"
+ KeyValuePair:
+ - key: "clientId"
+ value: "1234"
+ - key: "userId"
+ value: "alice"
+ - key: "userId"
+ value: "bob"</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_6_properties--panel" class="tabpanel" aria-labelledby="_tabs_6_properties">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ContextMapFilter.yaml"><code>log4j2.properties</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">filter.0.type = ContextMapFilter
+filter.0.operator = AND
+
+filter.0.kv0.type = KeyValuePair
+filter.0.kv0.key = clientId
+filter.0.kv0.value = 1234
+
+filter.0.kv1.type = KeyValuePair
+filter.0.kv1.key = userId
+filter.0.kv1.value = alice
+
+filter.0.kv2.type = KeyValuePair
+filter.0.kv2.key = userId
+filter.0.kv2.value = bob</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="admonitionblock tip">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-tip" title="Tip"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>You can use Log4j Core’s
+<a href="configuration.html#configuration-attribute-monitorInterval" class="xref page">automatic reconfiguration feature</a>
+to modify the <code>KeyValuePair</code>s without restarting your application.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ThreadContextMapFilter" class="xref page">📖 Plugin reference for <code>ContextMapFilter</code></a></p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="MutableThreadContextMapFilter"><a class="anchor" href="#MutableThreadContextMapFilter"></a><code>MutableContextMapFilter</code></h4>
+<div class="paragraph">
+<p>The <code>MutableContextMapFilter</code> is an alternative version of <a href="#ContextMapFilter"><code>ContextMapFilter</code></a> that also uses the
+<a href="thread-context.html" class="xref page">context data map</a>
+to filter messages, but externalizes the <a href="#configuration-map">Configuration map</a>, so it can be kept in a separate location.</p>
+</div>
+<div class="paragraph">
+<p>This filter encodes the <a href="#configuration-map">Configuration map</a> as JSON.
+The configuration map must be stored in an <strong>external</strong> location and will be regularly polled for changes.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+the <code>MutableContextMapFilter</code> supports the following parameters:</p>
+</div>
+<table class="tableblock frame-all grid-all stretch">
+<caption class="title">Table 19. <code>MutableContextMapFilter</code> — configuration attributes</caption>
+<colgroup>
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 14.2857%;">
+<col style="width: 57.1429%;">
+</colgroup>
+<thead>
+<tr>
+<th class="tableblock halign-left valign-top">Attribute</th>
+<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Default value</th>
+<th class="tableblock halign-left valign-top">Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>configLocation</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html"><code>Path</code></a>
+or
+<a href="https://docs.oracle.com/javase/8/docs/api/java/net/URI.html"><code>URI</code></a></p></td>
+<td class="tableblock halign-left valign-top"></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The location of the JSON <a href="#configuration-map">Configuration map</a>.</p>
+<p class="tableblock"><strong>Required</strong></p></td>
+</tr>
+<tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>pollInterval</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>long</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>0</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">Determines the polling interval used by Log4j to check for changes to the configuration map.</p>
+<p class="tableblock">If set to <code>0</code>, polling is disabled.</p></td>
+</tr>
+</tbody>
+</table>
+<div class="admonitionblock warning">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-warning" title="Warning"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>Unlike other map filters that have a configurable matching mode,
+this filter always uses the <a href="#matching-mode-or">OR</a> matching mode.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+<div class="paragraph">
+<p>To use this filter, you need to:</p>
+</div>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>Create a JSON configuration map and place it at a known location (e.g. <code>https://server.example/configs.json</code>):</p>
+<div class="listingblock">
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">{
+ "configs": {
+ "clientId": [
+ "1234" <i class="conum" data-value="1"></i><b>(1)</b>
+ ],
+ "userId": [
+ "root" <i class="conum" data-value="2"></i><b>(2)</b>
+ ]
+ }
+}</code></pre>
+</div>
+</div>
+<div class="colist arabic">
+<table>
+<tr>
+<td><i class="conum" data-value="1"></i><b>1</b></td>
+<td>The filter will match all events for client <code>1234</code> regardless of the <code>userId</code>.</td>
+</tr>
+<tr>
+<td><i class="conum" data-value="2"></i><b>2</b></td>
+<td>The filter will match all events for the <code>root</code> account regardless of the <code>clientId</code>.</td>
+</tr>
+</table>
+</div>
+</li>
+<li>
+<p>Reference the configuration map location in your configuration file:</p>
+<div id="_tabs_7" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_7_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_7_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_7_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_7_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
+</div>
+<div id="_tabs_7_xml--panel" class="tabpanel" aria-labelledby="_tabs_7_xml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MutableContextMapFilter.xml"><code>log4j2.xml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><MutableContextMapFilter
+ configLocation="https://server.example/configs.json"
+ pollInterval="10"/></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_7_json--panel" class="tabpanel" aria-labelledby="_tabs_7_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MutableContextMapFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"MutableContextMapFilter": {
+ "configLocation": "https://server.example/configs.json",
+ "pollInterval": 10
+}</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_7_yaml--panel" class="tabpanel" aria-labelledby="_tabs_7_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MutableContextMapFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">MutableContextMapFilter:
+ configLocation: "https://server.example/configs.json"
+ pollInterval: 10</code></pre>
+</div>
</div>
+</div>
+<div id="_tabs_7_properties--panel" class="tabpanel" aria-labelledby="_tabs_7_properties">
<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/MutableContextMapFilter.yaml"><code>log4j2.properties</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <RegexFilter regex=".* test .*" onMatch="ACCEPT" onMismatch="DENY"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">filter.0.type = MutableContextMapFilter
+filter.0.configLocation = https://server.example/configs.json
+filter.0.pollInterval = 10</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+</li>
+</ol>
</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-MutableThreadContextMapFilter" class="xref page">📖 Plugin reference for <code>MutableContextMapFilter</code></a></p>
+</div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="other-filters"><a class="anchor" href="#other-filters"></a>Other filters</h3>
+<div class="sect3">
+<h4 id="deny-filter"><a class="anchor" href="#deny-filter"></a><code>DenyFilter</code></h4>
+<div class="paragraph">
+<p>The <code>DenyFilter</code> always returns <code>DENY</code>.
+It does not support <strong>any</strong> configuration attribute, even the common configuration attributes.</p>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-DenyAllFilter" class="xref page">📖 Plugin reference for <code>DenyAllFilter</code></a></p>
</div>
-<div id="Script" class="paragraph">
-<p>The ScriptFilter executes a script that returns true or false.</p>
+</div>
+<div class="sect3">
+<h4 id="Script"><a class="anchor" href="#Script"></a><code>ScriptFilter</code></h4>
+<div class="paragraph">
+<p>The <code>ScriptFilter</code> executes a script that must return <code>true</code> if the event matches and <code>false</code> otherwise.</p>
+</div>
+<div class="paragraph">
+<p>Besides the <a href="#common-configuration-attributes">common configuration attributes</a>,
+it accepts a single nested element:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 9. Script Filter Parameters</caption>
+<caption class="title">Table 20. <code>ScriptFilter</code> — nested elements</caption>
<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
+<col style="width: 37.5%;">
+<col style="width: 12.5%;">
+<col style="width: 50%;">
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
<th class="tableblock halign-left valign-top">Type</th>
+<th class="tableblock halign-left valign-top">Multiplicity</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>script</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Script, ScriptFile or ScriptRef</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The Script element that specifies the logic to be executed.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the script returns true. Can be
-ACCEPT, DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter returns false. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="scripts.html#Script" class="xref page"><code>Script</code></a>,
+<a href="scripts.html#ScriptFile" class="xref page"><code>ScriptFile</code></a>
+or
+<a href="scripts.html#ScriptRef" class="xref page"><code>ScriptRef</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">one</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">A reference to the script to execute.</p>
+<p class="tableblock">See <a href="scripts.html" class="xref page">Scripts</a> for more details about scripting.</p></td>
</tr>
</tbody>
</table>
+<div class="paragraph">
+<p>The bindings available to the script depend
+on whether the <code>ScriptFilter</code> is used as a global filter in the <a href="#logger-stage">Logger stage</a> or in the remaining stages.
+For global filters, the following bindings are available:</p>
+</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 10. Script Parameters</caption>
+<caption class="title">Table 21. Script Bindings — global filter</caption>
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
@@ -1353,117 +2850,71 @@ be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Binding name</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>configuration</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Configuration</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The Configuration that owns this
-ScriptFilter.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>logger</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Logger.html"><code>Logger</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The logger used in the log statement.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>level</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Level</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The logging Level associated with the event. Only present
-when configured as a global filter.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>loggerName</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The name of the logger. Only present when
-configured as a global filter.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>logEvent</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">LogEvent</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The LogEvent being processed. Not present when
-configured as a global filter.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="customloglevels.html" class="xref page"><code>Level</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The level used in the log statement.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>marker</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Marker</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The Marker passed on the logging call, if any. Only
-present when configured as a global filter.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="markers.html" class="xref page"><code>Marker</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The marker used in the log statement.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>message</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Message</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The Message associated with the logging call. Only
-present when configured as a global filter.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="messages.html" class="xref page"><code>Message</code></a></p></td>
+<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
+<p>The message used in the log event if the user directly supplied one.
+Otherwise:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>If the logging statement contained an <code>Object</code> argument, it is wrapped in a
+<a href="messages.html#ObjectMessage" class="xref page"><code>ObjectMessage</code></a>.</p>
+</li>
+<li>
+<p>If the logging statement contained a format <code>String</code>, it is wrapped in a
+<a href="messages.html#SimpleMessage" class="xref page"><code>SimpleMessage</code></a>.</p>
+</li>
+</ul>
+</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>parameters</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Object[]</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The parameters passed to the logging call. Only
-present when configured as a global filter. Some Messages include the
-parameters as part of the Message.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Object[]</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The parameters passed to the logging call.
+Some logging calls include the parameters as part of <code>message</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>throwable</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Throwable</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The Throwable passed to the logging call, if any.
-Only present when configured as a global filter. Som Messages include
-Throwable as part of the Message.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Throwable</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The <code>Throwable</code> passed to the logging call, if any.
+Some logging calls include the <code>Throwable</code> as part of <code>message</code>.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>substitutor</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">StrSubstitutor</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The StrSubstitutor is used to replace lookup variables.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrSubstitutor.html"><code>StrSubstitutor</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The <code>StrSubstitutor</code> used to replace lookup variables.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
-<p>The sample below shows how to declare script fields and then reference them in specific components.
-See
-<a href="appenders.html#ScriptCondition" class="xref page">ScriptCondition</a> for an example of how the <code>ScriptPlugin</code> element can be used to embed script code directly in the configuration.</p>
-</div>
-<div class="listingblock">
-<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="ERROR">
- <Scripts>
- <ScriptFile name="filter.js" language="JavaScript" path="src/test/resources/scripts/filter.js" charset="UTF-8" />
- <ScriptFile name="filter.groovy" language="groovy" path="src/test/resources/scripts/filter.groovy" charset="UTF-8" />
- </Scripts>
- <Appenders>
- <List name="List">
- <PatternLayout pattern="[%-5level] %c{1.} %msg%n"/>
- </List>
- </Appenders>
- <Loggers>
- <Logger name="TestJavaScriptFilter" level="trace" additivity="false">
- <AppenderRef ref="List">
- <ScriptFilter onMatch="ACCEPT" onMisMatch="DENY">
- <ScriptRef ref="filter.js" />
- </ScriptFilter>
- </AppenderRef>
- </Logger>
- <Logger name="TestGroovyFilter" level="trace" additivity="false">
- <AppenderRef ref="List">
- <ScriptFilter onMatch="ACCEPT" onMisMatch="DENY">
- <ScriptRef ref="filter.groovy" />
- </ScriptFilter>
- </AppenderRef>
- </Logger>
- <Root level="trace">
- <AppenderRef ref="List" />
- </Root>
- </Loggers>
-</Configuration></code></pre>
-</div>
-</div>
-</div>
-<div class="sect2">
-<h3 id="StructuredDataFilter"><a class="anchor" href="#StructuredDataFilter"></a>StructuredDataFilter</h3>
-<div class="paragraph">
-<p>The StructuredDataFilter is a MapFilter that also allows filtering on the event id, type and message.</p>
+<p>For the remaining filters, only these bindings are available:</p>
</div>
<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 11. StructuredData Filter Parameters</caption>
+<caption class="title">Table 22. Script Bindings — internal filter</caption>
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
@@ -1471,325 +2922,202 @@ See
</colgroup>
<thead>
<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
+<th class="tableblock halign-left valign-top">Binding name</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>keyValuePair</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">KeyValuePair[]</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">One or more KeyValuePair elements that
-define the key in the map and the value to match on. "id", "id.name",
-"type", and "message" should be used to match the StructuredDataId,
-the name portion of the StructuredDataId, the type, and the formatted
-message respectively. If the same key is specified more than once then
-the check for that key will automatically be an "or" since a Map can
-only contain a single value.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">If the operator is "or" then a match by any one of
-the key/value pairs will be considered to be a match, otherwise all the
-key/value pairs must match.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>logEvent</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/LogEvent.html"><code>LogEvent</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The log event being processed.</p></td>
</tr>
<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>substitutor</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrSubstitutor.html"><code>StrSubstitutor</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock">The <code>StrSubstitutor</code> used to replace lookup variables.</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
-<p>As in this configuration, the StructuredDataFilter can be used to log particular events:</p>
+<p>As an example, if you wish to match only log events that contain a certain exception,
+you can use a simple Groovy script:</p>
</div>
<div class="listingblock">
+<div class="title"><code>scripts/local.groovy</code></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <StructuredDataFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
- <KeyValuePair key="id" value="Login"/>
- <KeyValuePair key="id" value="Logout"/>
- </StructuredDataFilter>
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">return logEvent.throwable instanceof DataAccessException;</code></pre>
</div>
</div>
-</div>
-<div class="sect2">
-<h3 id="ThreadContextMapFilter"><a class="anchor" href="#ThreadContextMapFilter"></a>ThreadContextMapFilter</h3>
<div class="paragraph">
-<p>The ThreadContextMapFilter or ContextMapFilter allows filtering against data elements that are in the current context.
-By default, this is the ThreadContext Map.</p>
+<p>You can then integrate the script in a Log4j configuration:</p>
</div>
-<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 12. Context Map Filter Parameters</caption>
-<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
-</colgroup>
-<thead>
-<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
-<th class="tableblock halign-left valign-top">Type</th>
-<th class="tableblock halign-left valign-top">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>keyValuePair</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">KeyValuePair[]</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">One or more KeyValuePair elements that
-define the key in the map and the value to match. If the same key is
-specified more than once then the check for that key will automatically
-be an "or" since a Map can only contain a single value.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>operator</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">If the operator is "or" then a match by any one of
-the key/value pairs will be considered to be a match, otherwise all the
-key/value pairs must match.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
-</tr>
-</tbody>
-</table>
-<div class="paragraph">
-<p>A configuration containing the ContextMapFilter might look like:</p>
+<div id="_tabs_8" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_8_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_8_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_8_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_8_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
</div>
+<div id="_tabs_8_xml--panel" class="tabpanel" aria-labelledby="_tabs_8_xml">
<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.xml"><code>log4j2.xml</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <ContextMapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
- <KeyValuePair key="User1" value="DEBUG"/>
- <KeyValuePair key="User2" value="WARN"/>
- </ContextMapFilter>
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><Root level="ALL">
+ <ScriptFilter>
+ <ScriptFile language="groovy" path="scripts/local.groovy"/>
+ </ScriptFilter>
+ <AppenderRef ref="CONSOLE"/>
+</Root></code></pre>
</div>
</div>
-<div class="paragraph">
-<p>The ContextMapFilter can also be applied to a logger for filtering:</p>
</div>
+<div id="_tabs_8_json--panel" class="tabpanel" aria-labelledby="_tabs_8_json">
<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.json"><code>log4j2.json</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <BurstFilter level="INFO" rate="16" maxBurst="100"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- <ContextMapFilter onMatch="ACCEPT" onMismatch="NEUTRAL" operator="or">
- <KeyValuePair key="foo" value="bar"/>
- <KeyValuePair key="User2" value="WARN"/>
- </ContextMapFilter>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"Root": {
+ "level": "ALL",
+ "ScriptFilter": {
+ "ScriptFile": {
+ "language": "groovy",
+ "path": "scripts/local.groovy"
+ }
+ },
+ "AppenderRef": {
+ "ref": "CONSOLE"
+ }
+}</code></pre>
</div>
</div>
</div>
-<div class="sect2">
-<h3 id="ThresholdFilter"><a class="anchor" href="#ThresholdFilter"></a>ThresholdFilter</h3>
-<div class="paragraph">
-<p>This filter returns the onMatch result if the level in the LogEvent is the same or more specific than the configured level and the <code>onMismatch</code>
-value otherwise.
-For example, if the ThresholdFilter is configured with Level ERROR and the LogEvent contains Level DEBUG then the <code>onMismatch</code>
-value will be returned since ERROR events are more specific than DEBUG.</p>
+<div id="_tabs_8_yaml--panel" class="tabpanel" aria-labelledby="_tabs_8_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">Root:
+ level: "ALL"
+ ScriptFilter:
+ ScriptFile:
+ language: "groovy"
+ path: "scripts/local.groovy"
+ AppenderRef:
+ ref: "CONSOLE"</code></pre>
+</div>
</div>
-<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 13. Threshold Filter Parameters</caption>
-<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
-</colgroup>
-<thead>
-<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
-<th class="tableblock halign-left valign-top">Type</th>
-<th class="tableblock halign-left valign-top">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>level</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">A valid Level name to match.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
-</tr>
-</tbody>
-</table>
-<div class="paragraph">
-<p>A sample configuration that only allows the event to be written by the appender if the level matches:</p>
</div>
+<div id="_tabs_8_properties--panel" class="tabpanel" aria-labelledby="_tabs_8_properties">
<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.yaml"><code>log4j2.properties</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">rootLogger.level = ALL
+
+rootLogger.filter.0.type = ScriptFilter
+rootLogger.filter.0.script.type = ScriptFile
+rootLogger.filter.0.script.language = groovy
+rootLogger.filter.0.script.path = scripts/local.groovy
+
+rootLogger.appenderRef.0.ref = CONSOLE</code></pre>
+</div>
+</div>
</div>
</div>
</div>
-<div class="sect2">
-<h3 id="TimeFilter"><a class="anchor" href="#TimeFilter"></a>TimeFilter</h3>
<div class="paragraph">
-<p>The time filter can be used to restrict the filter to only a certain portion of the day.</p>
+<p>Writing an equivalent <strong>global</strong> script is a little bit more complex,
+since you need to take into account all the places where a throwable can be passed as a parameter.
+The script becomes:</p>
+</div>
+<div class="listingblock">
+<div class="title"><code>scripts/global.groovy</code></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">Throwable lastParam = parameters?.last() instanceof Throwable ? parameters.last() : null
+Throwable actualThrowable = throwable ?: message?.throwable ?: lastParam
+return actualThrowable instanceof DataAccessException</code></pre>
+</div>
</div>
-<table class="tableblock frame-all grid-all stretch">
-<caption class="title">Table 14. Time Filter Parameters</caption>
-<colgroup>
-<col style="width: 16.6666%;">
-<col style="width: 16.6666%;">
-<col style="width: 66.6668%;">
-</colgroup>
-<thead>
-<tr>
-<th class="tableblock halign-left valign-top">Parameter Name</th>
-<th class="tableblock halign-left valign-top">Type</th>
-<th class="tableblock halign-left valign-top">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>start</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">A time in HH:mm:ss format.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>end</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">A time in HH:mm:ss format. Specifying an end time less
-than the start time will result in no log entries being written.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>timezone</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">The timezone to use when comparing to the event
-timestamp.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter matches. Can be ACCEPT,
-DENY or NEUTRAL. The default value is NEUTRAL.</p></td>
-</tr>
-<tr>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>onMismatch</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">String</p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock">Action to take when the filter does not match. Can
-be ACCEPT, DENY or NEUTRAL. The default value is DENY.</p></td>
-</tr>
-</tbody>
-</table>
<div class="paragraph">
-<p>A sample configuration that only allows the event to be written by the appender from 5:00 to 5:30 am each day using the default timezone:</p>
+<p>You can use it as a global filter:</p>
+</div>
+<div id="_tabs_9" class="openblock tabs is-sync is-loading">
+<div class="content">
+<div class="ulist tablist">
+<ul>
+<li id="_tabs_9_xml" class="tab">
+<p>XML</p>
+</li>
+<li id="_tabs_9_json" class="tab">
+<p>JSON</p>
+</li>
+<li id="_tabs_9_yaml" class="tab">
+<p>YAML</p>
+</li>
+<li id="_tabs_9_properties" class="tab">
+<p>Properties</p>
+</li>
+</ul>
</div>
+<div id="_tabs_9_xml--panel" class="tabpanel" aria-labelledby="_tabs_9_xml">
<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.xml"><code>log4j2.xml</code></a></div>
<div class="content">
-<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="warn" name="MyApp">
- <Appenders>
- <RollingFile name="RollingFile" fileName="logs/app.log"
- filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">
- <TimeFilter start="05:00:00" end="05:30:00" onMatch="ACCEPT" onMismatch="DENY"/>
- <PatternLayout>
- <pattern>%d %p %c{1.} [%t] %m%n</pattern>
- </PatternLayout>
- <TimeBasedTriggeringPolicy />
- </RollingFile>
- </Appenders>
- <Loggers>
- <Root level="error">
- <AppenderRef ref="RollingFile"/>
- </Root>
- </Loggers>
-</Configuration></code></pre>
+<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><ScriptFilter>
+ <ScriptFile language="groovy" path="scripts/global.groovy"/>
+</ScriptFilter></code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_9_json--panel" class="tabpanel" aria-labelledby="_tabs_9_json">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.json"><code>log4j2.json</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">"ScriptFilter": {
+ "ScriptFile": {
+ "language": "groovy",
+ "path": "scripts/global.groovy"
+ }
+}</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_9_yaml--panel" class="tabpanel" aria-labelledby="_tabs_9_yaml">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.yaml"><code>log4j2.yaml</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-yaml hljs" data-lang="yaml">ScriptFilter:
+ ScriptFile:
+ language: "groovy"
+ path: "scripts/global.groovy"</code></pre>
+</div>
+</div>
+</div>
+<div id="_tabs_9_properties--panel" class="tabpanel" aria-labelledby="_tabs_9_properties">
+<div class="listingblock">
+<div class="title">Snippet from an example <a href="https://github.com/apache/logging-log4j2/tree/2.x/src/site/antora/modules/ROOT/examples/manual/filters/ScriptFilter.yaml"><code>log4j2.properties</code></a></div>
+<div class="content">
+<pre class="highlightjs highlight"><code class="language-properties hljs" data-lang="properties">filter.0.type = ScriptFilter
+filter.0.script.type = ScriptFile
+filter.0.script.language = groovy
+filter.0.script.path = scripts/global.groovy</code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="paragraph">
+<p><a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ScriptFilter" class="xref page">📖 Plugin reference for <code>ScriptFilter</code></a></p>
</div>
</div>
</div>
@@ -1834,8 +3162,12 @@ Refer to <a href="plugins.html" class="xref page">Plugins</a> for details.</p>
<div class="sect2">
<h3 id="extending-filters"><a class="anchor" href="#extending-filters"></a>Extending filters</h3>
<div class="paragraph">
-<p>Filter are <a href="plugins.html" class="xref page">plugins</a> implementing <a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Filter.html">the <code>Filter</code> interface</a>.
-We recommend users to extend from <a href="../javadoc/log4j-core/org/apache/logging/log4j/core/filter/AbstractFilter.html"><code>AbstractFilter</code></a>, which provides implementation convenience.
+<p>Filters are <a href="plugins.html" class="xref page">plugins</a>
+implementing <a href="../javadoc/log4j-core/org/apache/logging/log4j/core/Filter.html">the <code>Filter</code>
+interface</a>.
+We recommend users
+to extend from <a href="../javadoc/log4j-core/org/apache/logging/log4j/core/filter/AbstractFilter.html"><code>AbstractFilter</code></a>,
+which provides implementation convenience.
While annotating your filter with <code>@Plugin</code>, you need to make sure that</p>
</div>
<div class="ulist">
@@ -1854,10 +3186,10 @@ While annotating your filter with <code>@Plugin</code>, you need to make sure th
<div class="ulist">
<ul>
<li>
-<p><a href="https://github.com/apache/logging-log4j2/tree/2.x/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java"><code>MarkerFilter.java</code></a> – <a href="#MarkerFilter">MarkerFilter</a> matching on markers associated with the effective <code>LogEvent</code> in the context</p>
+<p><a href="https://github.com/apache/logging-log4j2/tree/2.x/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/MarkerFilter.java"><code>MarkerFilter.java</code></a> – <a href="#MarkerFilter"><code>MarkerFilter</code></a> matching on markers associated with the effective <code>LogEvent</code> in the context</p>
</li>
<li>
-<p><a href="https://github.com/apache/logging-log4j2/tree/2.x/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java"><code>RegexFilter.java</code></a> – <a href="#RegexFilter">RegexFilter</a> matching on the message associated with the effective <code>LogEvent</code> in the context</p>
+<p><a href="https://github.com/apache/logging-log4j2/tree/2.x/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/RegexFilter.java"><code>RegexFilter.java</code></a> – <a href="#RegexFilter"><code>RegexFilter</code></a> matching on the message associated with the effective <code>LogEvent</code> in the context</p>
</li>
</ul>
</div>
diff --git a/manual/messages.html b/manual/messages.html
index 36a3215a48..664058a1c2 100644
--- a/manual/messages.html
+++ b/manual/messages.html
@@ -653,7 +653,7 @@ It works as follows:</p>
</div>
</div>
<div class="sect3">
-<h4 id="LocalizedMessage"><a class="anchor" href="#LocalizedMessage"></a>LocalizedMessage</h4>
+<h4 id="LocalizedMessage"><a class="anchor" href="#LocalizedMessage"></a><code>LocalizedMessage</code></h4>
<div class="paragraph">
<p><a href="../javadoc/log4j-api/org/apache/logging/log4j/message/LocalizedMessage.html"><code>LocalizedMessage</code></a> incorporates a <code>ResourceBundle</code>, and allows the message pattern parameter to be the key to the message pattern in the bundle.
If no bundle is specified, <code>LocalizedMessage</code> will attempt to locate a bundle with the name of the <code>Logger</code> used to log the event.
diff --git a/manual/scripts.html b/manual/scripts.html
index 94267dacad..9bf5257d12 100644
--- a/manual/scripts.html
+++ b/manual/scripts.html
@@ -369,7 +369,7 @@ configuration property.</p>
<div class="paragraph">
<p>Each component that allows scripts can contain on of the following configuration elements:</p>
</div>
-<div class="dlist">
+<div id="Script" class="dlist">
<dl>
<dt class="hdlist1">Script</dt>
<dd>
@@ -400,6 +400,10 @@ This allows the usage of a <code>CDATA</code> block.</p>
<a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-script-Script" class="xref page">Plugin reference</a>.</p>
</div>
</dd>
+</dl>
+</div>
+<div id="ScriptFile" class="dlist">
+<dl>
<dt class="hdlist1">ScriptFile</dt>
<dd>
<div class="paragraph">
@@ -432,6 +436,10 @@ If set to <code>true</code> the script file will be monitored for changes.</p>
<a href="../plugin-reference.html#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-script-ScriptFile" class="xref page">Plugin reference</a>.</p>
</div>
</dd>
+</dl>
+</div>
+<div id="ScriptRef" class="dlist">
+<dl>
<dt class="hdlist1">ScriptRef</dt>
<dd>
<div class="paragraph">
diff --git a/manual/systemproperties.html b/manual/systemproperties.html
index df34b84496..9e0f2c7b0e 100644
--- a/manual/systemproperties.html
+++ b/manual/systemproperties.html
@@ -755,7 +755,7 @@ to use when the underlying async component cannot keep up with the logging rate
</table>
<div class="paragraph">
<p>Determines the threshold level used by a <code>Discard</code> queue full policy.
-Log events whose level is equal or less specific than the threshold level will be discarded during a queue full event.
+Log events whose level is not more severe than the threshold level will be discarded during a queue full event.
See also <a href="#log4j2.asyncQueueFullPolicy"><code>log4j2.asyncQueueFullPolicy</code></a>.</p>
</div>
</div>
diff --git a/plugin-reference.html b/plugin-reference.html
index c59376b8e9..c78ad098e5 100644
--- a/plugin-reference.html
+++ b/plugin-reference.html
@@ -1468,7 +1468,7 @@ Originally developed by Ceki Glc and Anders Kristensen.</p>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>header</code></p></td>
-<td class="tableblock halign-left valign-top"><p class="tableblock"><code>boolean?</code></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String?</code></p></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"><div class="content"></div></td>
</tr>
diff --git a/sitemap.xml b/sitemap.xml
index cc4956522a..93f035e67a 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,234 +2,234 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://logging.apache.org/log4j/2.x/development.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/download.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/faq.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/hibernate.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/index.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/javadoc.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-cassandra.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-couchdb.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-docker.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-flume-ng.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-iostreams.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-jul.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-spring-boot.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-spring-cloud-config-client.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-spring-cloud-config.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/log4j-to-jul.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/api.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/appenders.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/architecture.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/async.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/cloud.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/compatibility.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/config-intro.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/configuration.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/customconfig.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/customloglevels.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/eventlogging.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/extending.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/filters.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/flowtracing.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/garbagefree.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/getting-started.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/index.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/installation.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/jmx.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/json-template-layout.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/layouts.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/logbuilder.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/logsep.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/lookups.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/markers.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/messages.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/migration.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/pattern-layout.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/performance.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/plugins.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/resource-logger.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/scoped-context.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/scripts.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/simple-logger.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/status-logger.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/systemproperties.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/thread-context.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/manual/webapp.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/migrate-from-logback.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/migrate-from-slf4j.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/plugin-reference.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
<url>
<loc>https://logging.apache.org/log4j/2.x/release-notes.html</loc>
-<lastmod>2024-07-08T11:15:04.634Z</lastmod>
+<lastmod>2024-07-08T11:30:10.290Z</lastmod>
</url>
</urlset>