You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/site/antora/modules/ROOT/pages/manual/lookups.adoc
+41-3Lines changed: 41 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,8 +72,11 @@ plugins, each one associated with a prefix, which retrieve data from external so
72
72
`StrLookup` is a simple map-like interface.
73
73
The main difference between a map and `StrLookup` is that the latter can compute the value of a key programmatically in a global context or in the context of log event.
74
74
75
+
[#common-concerns]
76
+
== Common concerns
77
+
75
78
[#evaluation-contexts]
76
-
== Evaluation contexts
79
+
=== Evaluation contexts
77
80
78
81
Each lookup has an associated prefix, and Log4j can evaluate it in one of the following ways:
Don't use `$$+{marker:}+` in the xref:manual/pattern-layout.adoc[] conversion patterns!
699
733
Use xref:manual/pattern-layout.adoc#converter-marker[the `%markerSimpleName` pattern converter] instead.
734
+
735
+
See <<lookups-patterns>> for more information.
700
736
====
701
737
702
738
[#SpringBootLookup]
@@ -800,8 +836,10 @@ of a `StructuredDataMessage`.
800
836
801
837
[TIP]
802
838
====
803
-
Except `++$${sd:id}++` and `++$${sd:type}++`, don't use `++$${sd:key}++` in the xref:manual/pattern-layout.adoc[] conversion patterns!
839
+
Except `++$${sd:id}++` and `++$${sd:type}++`, don't use other `++$${sd:key}++` expressions in the xref:manual/pattern-layout.adoc[] conversion patterns!
804
840
Use xref:manual/pattern-layout.adoc#converter-map[the `%K\{key}` pattern converter] instead.
841
+
842
+
See <<lookups-patterns>> for more information.
805
843
====
806
844
807
845
[#SystemPropertiesLookup]
@@ -983,7 +1021,7 @@ While annotating your lookup with `@Plugin`, you need to make sure that
983
1021
* It has a unique `name` attribute across all available `StrLookup` plugins
984
1022
* The `category` attribute is set to link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrLookup.html#CATEGORY[`StrLookup.CATEGORY`]
985
1023
986
-
You can check out following files for examples:
1024
+
You can check out the following files for examples:
987
1025
988
1026
* {project-github-url}/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/DateLookup.java[`LowerLookup.java`] – <<LowerLookup>> lower-cases its input
989
1027
* {project-github-url}/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/EventLookup.java[`EventLookup.java`] – <<EventLookup>> extracts specified fields from the effective `LogEvent` in the context
0 commit comments