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
** If `name` does not contain a colon `:` character, the Interpolator uses the
64
+
xref:manual/configuration.adoc#global-properties[`Properties` configuration element] to resolve its value.
65
+
66
+
** If `name` is of the form `prefix:key`, the Interpolator delegates the lookup to a `StrLookup` associated with `prefix` and falls back to evaluating `$+{key}+` if the lookup was not successful.
plugins that provide values for simple `$+{prefix:key}+` expressions.
70
+
plugins, each one associated with a prefix, which retrieve data from external sources.
29
71
30
72
`StrLookup` is a simple map-like interface.
31
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.
@@ -51,10 +93,12 @@ In the context of a log event `event`, Log4j evaluates `$+{prefix:key}+` express
51
93
link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrLookup.html#lookup(org.apache.logging.log4j.core.LogEvent,java.lang.String)[`lookup(event, "key")`] on the lookup associated to `prefix`.
52
94
The result of this call might take into account the contents of the log event, besides the global state of the system.
53
95
54
-
The xref:manual/pattern-layout.adoc#plugin-attr-pattern[`pattern`] attribute of `PatternLayout` is an example of attribute that supports both evaluation contexts:
96
+
Some configuration attributes (e.g., xref:manual/pattern-layout.adoc#plugin-attr-pattern[the `pattern` attribute of Pattern Layout]) supports both evaluation contexts:
55
97
56
98
* During the configuration process the `$+{...}+` expressions are evaluated using a global context.
57
-
* For each log event the `$$+{...}+` expressions are evaluated, using the log event as context.
99
+
The same process converts escaped `$$+{...}+` expressions to `$+{...}+` expressions.
100
+
101
+
* For each log event, the remaining expressions are evaluated, using the log event as context.
58
102
59
103
An example of lookup that can be used in both a global and event context is the `$+{date:...}+` lookup:
0 commit comments