This is an automated email from the ASF dual-hosted git repository.
vy pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x by this push:
new bc3321875c Link to example files and fix some JSON syntax
bc3321875c is described below
commit bc3321875c3839cf1c700461c2338b540e488577
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Tue Jun 25 14:39:02 2024 +0200
Link to example files and fix some JSON syntax
---
.../custom-wait-strategy.json | 0
.../custom-wait-strategy.properties | 0
.../custom-wait-strategy.xml | 0
.../custom-wait-strategy.yaml | 0
.../{configuration => async}/mixed-async.json | 0
.../mixed-async.properties | 0
.../{configuration => async}/mixed-async.xml | 0
.../{configuration => async}/mixed-async.yaml | 0
.../examples/manual/configuration/scripts.json | 65 ------------------
.../ROOT/examples/manual/customlevels/log4j2.json | 41 ------------
.../LevelExample.java | 0
.../examples/manual/customloglevels/log4j2.json | 41 ++++++++++++
.../log4j2.properties | 0
.../{customlevels => customloglevels}/log4j2.xml | 0
.../{customlevels => customloglevels}/log4j2.yaml | 0
.../ROOT/examples/manual/scripts/log4j2.json | 65 ++++++++++++++++++
.../log4j2.properties} | 0
.../scripts.xml => scripts/log4j2.xml} | 0
.../scripts.yaml => scripts/log4j2.yaml} | 0
.../antora/modules/ROOT/pages/manual/async.adoc | 25 ++++---
.../modules/ROOT/pages/manual/configuration.adoc | 77 ++++++++++++++--------
.../modules/ROOT/pages/manual/customloglevels.adoc | 20 +++---
.../antora/modules/ROOT/pages/manual/filters.adoc | 10 ++-
.../antora/modules/ROOT/pages/manual/markers.adoc | 15 +++--
.../antora/modules/ROOT/pages/manual/scripts.adoc | 12 ++--
.../modules/ROOT/partials/manual/log-event.adoc | 2 +-
26 files changed, 210 insertions(+), 163 deletions(-)
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.json
b/src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.json
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.json
rename to
src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.json
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.properties
b/src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.properties
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.properties
rename to
src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.properties
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.xml
b/src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.xml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.xml
rename to
src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.xml
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.yaml
b/src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.yaml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/custom-wait-strategy.yaml
rename to
src/site/antora/modules/ROOT/examples/manual/async/custom-wait-strategy.yaml
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.json
b/src/site/antora/modules/ROOT/examples/manual/async/mixed-async.json
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.json
rename to src/site/antora/modules/ROOT/examples/manual/async/mixed-async.json
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.properties
b/src/site/antora/modules/ROOT/examples/manual/async/mixed-async.properties
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.properties
rename to
src/site/antora/modules/ROOT/examples/manual/async/mixed-async.properties
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.xml
b/src/site/antora/modules/ROOT/examples/manual/async/mixed-async.xml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.xml
rename to src/site/antora/modules/ROOT/examples/manual/async/mixed-async.xml
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.yaml
b/src/site/antora/modules/ROOT/examples/manual/async/mixed-async.yaml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/mixed-async.yaml
rename to src/site/antora/modules/ROOT/examples/manual/async/mixed-async.yaml
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/scripts.json
b/src/site/antora/modules/ROOT/examples/manual/configuration/scripts.json
deleted file mode 100644
index 73db82029c..0000000000
--- a/src/site/antora/modules/ROOT/examples/manual/configuration/scripts.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "Configuration": {
- "Appenders": {
- "Console": {
- "name": "STDOUT",
- "PatternLayout": {
- "ScriptPatternSelector": {
- "defaultPattern": "%d %p %m%n",
- "ScriptRef": {
- "ref": "SELECTOR_SCRIPT",
- "PatternMatch": [
- {
- "key": "NoLocation",
- "pattern": "[%-5level] %c{1.} %msg%n"
- },
- {
- "key": "Flow",
- "pattern": "[%-5level] %c{1.} ====== %C{1.}.%M:%L %msg
======%n"
- }
- ]
- }
- }
- }
- },
- "Loggers": {
- "Logger": {
- "name": "EventLogger",
- "ScriptFilter": {
- "onMatch": "ACCEPT",
- "onMismatch": "DENY",
- "Script": {
- "name": "EVENT_LOGGER_FILTER",
- "language": "groovy",
- "scriptText": "if (logEvent.getMarker() != null &&
logEvent.getMarker().isInstanceOf('FLOW'))) { return true; } else if
(logEvent.getContextMap().containsKey('UserId')) { return true; } return false;"
- }
- }
- },
- "Root": {
- "level": "INFO",
- "ScriptFilter": {
- "onMatch": "ACCEPT",
- "onMismatch": "DENY",
- "ScriptRef": {
- "ref": "ROOT_FILTER"
- }
- },
- "AppenderRef": {
- "ref": "STDOUT"
- }
- },
- "Scripts": {
- "Script": {
- "name": "SELECTOR_SCRIPT",
- "language": "javascript",
- "scriptText": "var result; if
(logEvent.getLoggerName().equals('JavascriptNoLocation')) { result =
'NoLocation'; } else if (logEvent.getMarker() != null &&
logEvent.getMarker().isInstanceOf('FLOW')) { result = 'Flow'; } result;"
- },
- "ScriptFile": {
- "name": "ROOT_FILTER",
- "path": "scripts/filter.groovy"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git
a/src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.json
b/src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.json
deleted file mode 100644
index e29890d90c..0000000000
--- a/src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "Configuration": {
- "Appenders": {
- "Console": {
- "name": "CONSOLE",
- "PatternLayout": {
- "pattern": "%d [%t] %p %c - %m%n" // <1>
- }
- },
- "CustomLevels": { // <4>
- "CustomLevel": [
- {
- "name": "INFO2",
- "intLevel": 375
- },
- {
- "name": "INFO3",
- "intLevel": 350
- },
- {
- "name": "INFO4",
- "intLevel": 325
- }
- ]
- },
- "Loggers": {
- "Logger": {
- "name": "com.example",
- "level": "DEBUG" // <2>
- },
- "Root": {
- "level": "INFO2", // <5>
- "AppenderRef": {
- "ref": "CONSOLE",
- "level": "WARN" // <3>
- }
- }
- }
- }
- }
-}
diff --git
a/src/site/antora/modules/ROOT/examples/manual/customlevels/LevelExample.java
b/src/site/antora/modules/ROOT/examples/manual/customloglevels/LevelExample.java
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/customlevels/LevelExample.java
rename to
src/site/antora/modules/ROOT/examples/manual/customloglevels/LevelExample.java
diff --git
a/src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.json
b/src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.json
new file mode 100644
index 0000000000..df6bf334e4
--- /dev/null
+++ b/src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.json
@@ -0,0 +1,41 @@
+{
+ "Configuration": {
+ "Appenders": {
+ "Console": {
+ "name": "CONSOLE",
+ "PatternLayout": {
+ "pattern": "%d [%t] %p %c - %m%n" // <1>
+ }
+ }
+ },
+ "CustomLevels": { // <4>
+ "CustomLevel": [
+ {
+ "name": "INFO2",
+ "intLevel": 375
+ },
+ {
+ "name": "INFO3",
+ "intLevel": 350
+ },
+ {
+ "name": "INFO4",
+ "intLevel": 325
+ }
+ ]
+ },
+ "Loggers": {
+ "Logger": {
+ "name": "com.example",
+ "level": "DEBUG" // <2>
+ },
+ "Root": {
+ "level": "INFO2", // <5>
+ "AppenderRef": {
+ "ref": "CONSOLE",
+ "level": "WARN" // <3>
+ }
+ }
+ }
+ }
+}
diff --git
a/src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.properties
b/src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.properties
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.properties
rename to
src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.properties
diff --git
a/src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.xml
b/src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.xml
similarity index 100%
rename from src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.xml
rename to
src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.xml
diff --git
a/src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.yaml
b/src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.yaml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/customlevels/log4j2.yaml
rename to
src/site/antora/modules/ROOT/examples/manual/customloglevels/log4j2.yaml
diff --git a/src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.json
b/src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.json
new file mode 100644
index 0000000000..06f3bf627c
--- /dev/null
+++ b/src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.json
@@ -0,0 +1,65 @@
+{
+ "Configuration": {
+ "Appenders": {
+ "Console": {
+ "name": "STDOUT",
+ "PatternLayout": {
+ "ScriptPatternSelector": {
+ "defaultPattern": "%d %p %m%n",
+ "ScriptRef": {
+ "ref": "SELECTOR_SCRIPT",
+ "PatternMatch": [
+ {
+ "key": "NoLocation",
+ "pattern": "[%-5level] %c{1.} %msg%n"
+ },
+ {
+ "key": "Flow",
+ "pattern": "[%-5level] %c{1.} ====== %C{1.}.%M:%L %msg
======%n"
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "Loggers": {
+ "Logger": {
+ "name": "EventLogger",
+ "ScriptFilter": {
+ "onMatch": "ACCEPT",
+ "onMismatch": "DENY",
+ "Script": {
+ "name": "EVENT_LOGGER_FILTER",
+ "language": "groovy",
+ "scriptText": "if (logEvent.getMarker() != null &&
logEvent.getMarker().isInstanceOf('FLOW'))) { return true; } else if
(logEvent.getContextMap().containsKey('UserId')) { return true; } return false;"
+ }
+ }
+ },
+ "Root": {
+ "level": "INFO",
+ "ScriptFilter": {
+ "onMatch": "ACCEPT",
+ "onMismatch": "DENY",
+ "ScriptRef": {
+ "ref": "ROOT_FILTER"
+ }
+ },
+ "AppenderRef": {
+ "ref": "STDOUT"
+ }
+ }
+ },
+ "Scripts": {
+ "Script": {
+ "name": "SELECTOR_SCRIPT",
+ "language": "javascript",
+ "scriptText": "var result; if
(logEvent.getLoggerName().equals('JavascriptNoLocation')) { result =
'NoLocation'; } else if (logEvent.getMarker() != null &&
logEvent.getMarker().isInstanceOf('FLOW')) { result = 'Flow'; } result;"
+ },
+ "ScriptFile": {
+ "name": "ROOT_FILTER",
+ "path": "scripts/filter.groovy"
+ }
+ }
+ }
+}
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/scripts.properties
b/src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.properties
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/scripts.properties
rename to src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.properties
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/scripts.xml
b/src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.xml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/scripts.xml
rename to src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.xml
diff --git
a/src/site/antora/modules/ROOT/examples/manual/configuration/scripts.yaml
b/src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.yaml
similarity index 100%
rename from
src/site/antora/modules/ROOT/examples/manual/configuration/scripts.yaml
rename to src/site/antora/modules/ROOT/examples/manual/scripts/log4j2.yaml
diff --git a/src/site/antora/modules/ROOT/pages/manual/async.adoc
b/src/site/antora/modules/ROOT/pages/manual/async.adoc
index c3e42c8b0e..49a5e6e24b 100644
--- a/src/site/antora/modules/ROOT/pages/manual/async.adoc
+++ b/src/site/antora/modules/ROOT/pages/manual/async.adoc
@@ -123,33 +123,36 @@ A configuration that mixes asynchronous loggers might
look like:
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/async/mixed-async.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/mixed-async.xml[lines=1;18..-1]
+include::example$manual/async/mixed-async.xml[lines=31..40,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/async/mixed-async.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/mixed-async.json[]
+include::example$manual/async/mixed-async.json[lines=17..36,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/async/mixed-async.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/mixed-async.yaml[lines=17..-1]
+include::example$manual/async/mixed-async.yaml[lines=27..-1,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/async/mixed-async.properties[`log4j2.properties`]
[source,properties]
----
-include::example$manual/configuration/mixed-async.properties[lines=17..-1]
+include::example$manual/async/mixed-async.properties[lines=28..-1]
----
====
-
<1> All the appenders referenced by `Root` and `Logger` are called
synchronously.
This is especially important for audit logging, since exceptions can be
forwarded to the caller.
<2> All the appenders references by `AsyncRoot` and `AsyncLogger` are called
asynchronously.
@@ -194,30 +197,34 @@ to your configuration.
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/async/custom-wait-strategy.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/custom-wait-strategy.xml[lines=1;18..-1]
+include::example$manual/async/custom-wait-strategy.xml[lines=23,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/async/custom-wait-strategy.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/custom-wait-strategy.json[]
+include::example$manual/async/custom-wait-strategy.json[lines=3..5,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/async/custom-wait-strategy.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/custom-wait-strategy.yaml[lines=17..-1]
+include::example$manual/async/custom-wait-strategy.yaml[lines=18..-1]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/async/custom-wait-strategy.properties[`log4j2.properties`]
[source,properties]
----
-include::example$manual/configuration/custom-wait-strategy.properties[lines=17..-1]
+include::example$manual/async/custom-wait-strategy.properties[lines=17..-1]
----
====
diff --git a/src/site/antora/modules/ROOT/pages/manual/configuration.adoc
b/src/site/antora/modules/ROOT/pages/manual/configuration.adoc
index 5d9b94627b..3ae2eb6af2 100644
--- a/src/site/antora/modules/ROOT/pages/manual/configuration.adoc
+++ b/src/site/antora/modules/ROOT/pages/manual/configuration.adoc
@@ -259,6 +259,7 @@ A moderately complex configuration might look like this:
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/main-elements.xml[`log4j2.xml`]
[source,xml]
----
include::example$manual/configuration/main-elements.xml[lines=1;18..-1]
@@ -266,6 +267,7 @@
include::example$manual/configuration/main-elements.xml[lines=1;18..-1]
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/main-elements.json[`log4j2.json`]
[source,json]
----
include::example$manual/configuration/main-elements.json[]
@@ -273,6 +275,7 @@ include::example$manual/configuration/main-elements.json[]
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/main-elements.yaml[`log4j2.yaml`]
[source,yaml]
----
include::example$manual/configuration/main-elements.yaml[lines=17..-1]
@@ -280,12 +283,12 @@
include::example$manual/configuration/main-elements.yaml[lines=17..-1]
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/main-elements.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/configuration/main-elements.properties[lines=17..-1]
----
====
-
<1> Configures a console appender named `CONSOLE` with a pattern layout.
<2> Configures a file appender named `MAIN` with a JSON template layout.
<3> Configures a file appender named `DEBUG_LOG` with a pattern layout.
@@ -446,27 +449,31 @@ Let's start with an example of logger configuration:
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/loggers.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/loggers.xml[tag=loggers]
+include::example$manual/configuration/loggers.xml[tag=loggers,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/loggers.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/loggers.json[tag=loggers]
+include::example$manual/configuration/loggers.json[tag=loggers,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/loggers.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/loggers.yaml[tag=loggers]
+include::example$manual/configuration/loggers.yaml[tag=loggers,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/loggers.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/configuration/loggers.properties[tags=loggers]
@@ -628,27 +635,31 @@ Therefore, if you wish to insert a value that changes in
time, you must double t
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/logger-properties.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/logger-properties.xml[tag=loggers]
+include::example$manual/configuration/logger-properties.xml[tag=loggers,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/logger-properties.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/logger-properties.json[tag=loggers]
+include::example$manual/configuration/logger-properties.json[tag=loggers,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/logger-properties.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/logger-properties.yaml[tag=loggers]
+include::example$manual/configuration/logger-properties.yaml[tag=loggers,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/logger-properties.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/configuration/logger-properties.properties[tag=loggers]
@@ -706,6 +717,7 @@ Reusable configuration values can be added directly to a
configuration file by u
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/properties.xml[`log4j2.xml`]
[source,xml]
----
include::example$manual/configuration/properties.xml[lines=1;18..24;26]
@@ -713,23 +725,26 @@
include::example$manual/configuration/properties.xml[lines=1;18..24;26]
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/properties.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/properties.json[]
+include::example$manual/configuration/properties.json[lines=1..14]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/properties.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/properties.yaml[lines=17..-1]
+include::example$manual/configuration/properties.yaml[lines=17..23]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/properties.properties[`log4j2.properties`]
[source,properties]
----
-include::example$manual/configuration/properties.properties[lines=17..-1]
+include::example$manual/configuration/properties.properties[lines=17..18]
----
====
@@ -924,27 +939,31 @@ This case happens for the children of the `Route` element
below:
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/routing.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/routing.xml[tag=appender]
+include::example$manual/configuration/routing.xml[tag=appender,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/routing.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/routing.json[tag=appender]
+include::example$manual/configuration/routing.json[tag=appender,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/routing.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/routing.yaml[tag=appender]
+include::example$manual/configuration/routing.yaml[tag=appender,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/routing.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/configuration/routing.properties[tag=appender]
@@ -980,23 +999,26 @@ For example, you might want to use a different layout in
a production and develo
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/arbiters.xml[lines=1;18..-1]
+include::example$manual/configuration/arbiters.xml[lines=23..32,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/arbiters.json[]
+include::example$manual/configuration/arbiters.json[lines=3..24,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/arbiters.yaml[lines=17..-1]
+include::example$manual/configuration/arbiters.yaml[lines=18..29,indent=0]
----
Properties::
@@ -1020,35 +1042,38 @@ If none of the arbiters match, the configuration from
the `DefaultArbiter` eleme
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters-select.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/arbiters-select.xml[tag=select]
+include::example$manual/configuration/arbiters-select.xml[tag=select,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters-select.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/arbiters-select.json[tag=select]
+include::example$manual/configuration/arbiters-select.json[tag=select,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters-select.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/arbiters-select.yaml[tag=select]
+include::example$manual/configuration/arbiters-select.yaml[tag=select,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/configuration/arbiters-select.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/configuration/arbiters-select.properties[tag=select]
----
====
-
-<1> If the Java system property `env` has a value of `dev`, a pattern layout
will be used.
-<2> Otherwise, a JSON template layout will be used.
+<1> If the Java system property `env` has a value of `dev`, a Pattern Layout
will be used.
+<2> Otherwise, a JSON Template Layout will be used.
[#CompositeConfiguration]
== Composite Configuration
@@ -1131,21 +1156,21 @@ https://www.w3.org/TR/xinclude/[XInclude].
NOTE: The list of `XInclude` and `XPath` features supported depends upon your
https://docs.oracle.com/javase/{java-target-version}/docs/technotes/guides/xml/jaxp/index.html[JAXP
implementation].
-Here is an example log4j2.xml file that includes two other files:
+Here is an example `log4j2.xml` file that includes two other files:
-.log4j2.xml
+.Snippet from an example
{antora-examples-url}/manual/configuration/xinclude-main.xml[`log4j2.xml`]
[source,xml]
----
include::example$manual/configuration/xinclude-main.xml[lines=1;18..-1]
----
-.xinclude-appenders.xml
+.Snippet from an example
{antora-examples-url}/manual/configuration/xinclude-appenders.xml[`xinclude-appenders.xml`]
[source,xml]
----
include::example$manual/configuration/xinclude-appenders.xml[lines=1;18..-1]
----
-.xinclude-loggers.xml
+.Snippet from an example
{antora-examples-url}/manual/configuration/xinclude-loggers.xml[`xinclude-loggers.xml`]
[source,xml]
----
include::example$manual/configuration/xinclude-loggers.xml[lines=1;18..-1]
diff --git a/src/site/antora/modules/ROOT/pages/manual/customloglevels.adoc
b/src/site/antora/modules/ROOT/pages/manual/customloglevels.adoc
index b197e3dc63..fada282064 100644
--- a/src/site/antora/modules/ROOT/pages/manual/customloglevels.adoc
+++ b/src/site/antora/modules/ROOT/pages/manual/customloglevels.adoc
@@ -79,7 +79,7 @@ methods:
[source,java,indent=0]
----
-include::example$manual/customlevels/LevelExample.java[tag=standard]
+include::example$manual/customloglevels/LevelExample.java[tag=standard]
----
The `Logger` interface also contains shorthand methods that always log at a
specified log level:
@@ -119,7 +119,7 @@ By using shorthand methods, you can rewrite the example
above as:
[source,java,indent=0]
----
-include::example$manual/customlevels/LevelExample.java[tag=shorthand]
+include::example$manual/customloglevels/LevelExample.java[tag=shorthand]
----
[#level-selection]
@@ -158,14 +158,14 @@ method:
[source,java,indent=0]
----
-include::example$manual/customlevels/LevelExample.java[tag=custom-definition]
+include::example$manual/customloglevels/LevelExample.java[tag=custom-definition]
----
Custom log levels can be used in your code with the usual `Logger.log(..)` and
`Logger.atLevel(Level)` methods:
[source,java,indent=0]
----
-include::example$manual/customlevels/LevelExample.java[tag=custom]
+include::example$manual/customloglevels/LevelExample.java[tag=custom]
----
[#implementation-support]
@@ -198,30 +198,34 @@ configuration elements:
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/customloglevels/log4j2.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/customlevels/log4j2.xml[lines=1;18..-1]
+include::example$manual/customloglevels/log4j2.xml[lines=23..38,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/customloglevels/log4j2.json[`log4j2.json`]
[source,xml]
----
-include::example$manual/customlevels/log4j2.json[]
+include::example$manual/customloglevels/log4j2.json[lines=3..39,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/customloglevels/log4j2.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/customlevels/log4j2.yaml[lines=17..-1]
+include::example$manual/customloglevels/log4j2.yaml[lines=18..-1,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/customloglevels/log4j2.properties[`log4j2.properties`]
[source,properties]
----
-include::example$manual/customlevels/log4j2.properties[lines=17..-1]
+include::example$manual/customloglevels/log4j2.properties[lines=17..-1]
----
====
diff --git a/src/site/antora/modules/ROOT/pages/manual/filters.adoc
b/src/site/antora/modules/ROOT/pages/manual/filters.adoc
index fe7fc308cb..031192e3a2 100644
--- a/src/site/antora/modules/ROOT/pages/manual/filters.adoc
+++ b/src/site/antora/modules/ROOT/pages/manual/filters.adoc
@@ -36,27 +36,31 @@ To decide whether a log event from a certain logger is
delivered to a specific a
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/filters/filters.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/filters/filters.xml[lines=1;18..-1]
+include::example$manual/filters/filters.xml[lines=23..41,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/filters/filters.json[`log4j2.json`]
[source,json]
----
-include::example$manual/filters/filters.json[]
+include::example$manual/filters/filters.json[lines=3..35,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/filters/filters.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/filters/filters.yaml[lines=17..-1]
+include::example$manual/filters/filters.yaml[lines=18..-1]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/filters/filters.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/filters/filters.properties[lines=17..-1]
diff --git a/src/site/antora/modules/ROOT/pages/manual/markers.adoc
b/src/site/antora/modules/ROOT/pages/manual/markers.adoc
index 0cc8f583f1..5d98dbf601 100644
--- a/src/site/antora/modules/ROOT/pages/manual/markers.adoc
+++ b/src/site/antora/modules/ROOT/pages/manual/markers.adoc
@@ -119,33 +119,36 @@ regardless of the level of the events:
====
XML::
+
+.Snippet from an example
{antora-examples-url}/manual/markers/log4j2.xml[`log4j2.xml`]
[source,xml,indent=0]
----
-include::example$manual/markers/log4j2.xml[lines=1;18..-1]
+include::example$manual/markers/log4j2.xml[lines=23..37,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/manual/markers/log4j2.json[`log4j2.json`]
[source,json,indent=0]
----
-include::example$manual/markers/log4j2.json[]
+include::example$manual/markers/log4j2.json[lines=3..26,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/manual/markers/log4j2.yaml[`log4j2.yaml`]
[source,yaml,indent=0]
----
-include::example$manual/markers/log4j2.yaml[lines=17..-1]
+include::example$manual/markers/log4j2.yaml[lines=18..-1,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/manual/markers/log4j2.properties[`log4j2.properties`]
[source,properties]
----
include::example$manual/markers/log4j2.properties[lines=17..-1]
----
====
-
<1> Accepts all events marked with `SQL` regardless of their level,
<2> Only allow events marked with `SQL` or one of its children to be sent to
the `SQL_LOG` appender.
@@ -159,11 +162,11 @@ See https://logback.qos.ch/manual/filters.html[Logback
filters] for more informa
You can use a combination of `MarkerFilter`, `EvaluatorFilter` and
`OnMarkerEvaluator` to redirect all messages marked with `SQL` to a specific
appender, regardless of their level.
In order to do that, you can use a configuration as below:
+.Snippet from an example
{antora-examples-url}/manual/markers/logback.xml[`logback.xml`]
[source,xml]
----
-include::example$manual/markers/logback.xml[lines=1;18..-1]
+include::example$manual/markers/logback.xml[lines=19..36,indent=0]
----
-
<1> Accepts all events marked with `SQL` regardless of their level,
<2> Only allow events marked with `SQL` or one of its children to be sent to
the `SQL_LOG` appender.git
diff --git a/src/site/antora/modules/ROOT/pages/manual/scripts.adoc
b/src/site/antora/modules/ROOT/pages/manual/scripts.adoc
index 2d150312d6..eb25abcead 100644
--- a/src/site/antora/modules/ROOT/pages/manual/scripts.adoc
+++ b/src/site/antora/modules/ROOT/pages/manual/scripts.adoc
@@ -78,30 +78,34 @@ The environment in which the script runs is different for
each Log4j script-base
====
XML::
+
+.Snippet from an example {antora-examples-url}/scripts/log4j2.xml[`log4j2.xml`]
[source,xml]
----
-include::example$manual/configuration/scripts.xml[lines=1;18..-1]
+include::example$manual/scripts/log4j2.xml[lines=23..70,indent=0]
----
JSON::
+
+.Snippet from an example
{antora-examples-url}/scripts/log4j2.json[`log4j2.json`]
[source,json]
----
-include::example$manual/configuration/scripts.json[]
+include::example$manual/scripts/log4j2.json[lines=3..63,indent=0]
----
YAML::
+
+.Snippet from an example
{antora-examples-url}/scripts/log4j2.yaml[`log4j2.yaml`]
[source,yaml]
----
-include::example$manual/configuration/scripts.yaml[lines=17..-1]
+include::example$manual/scripts/log4j2.yaml[lines=18..-1,indent=0]
----
Properties::
+
+.Snippet from an example
{antora-examples-url}/scripts/log4j2.properties[`log4j2.properties`]
[source,properties]
----
-include::example$manual/configuration/scripts.properties[lines=17..-1]
+include::example$manual/scripts/log4j2.properties[lines=17..-1]
----
====
diff --git a/src/site/antora/modules/ROOT/partials/manual/log-event.adoc
b/src/site/antora/modules/ROOT/partials/manual/log-event.adoc
index 8421dc4cd6..967b90d1a5 100644
--- a/src/site/antora/modules/ROOT/partials/manual/log-event.adoc
+++ b/src/site/antora/modules/ROOT/partials/manual/log-event.adoc
@@ -22,7 +22,7 @@ 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
xref:manual/api.adoc#loggers[logger], e.g., `LOGGER.info("Hello, world!")`.
Hence, *log events are compound objects containing log messages*.
-.Read more on log events
+.Click for an introduction to log event fields
[%collapsible]
====
Log events contain fields that can be classified into three categories: