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
plugins that provide values for simple `$+{prefix:key}+` expressions.
29
29
30
30
`StrLookup` is a simple map-like interface.
31
-
The main difference between a map and `StrLookup` is
32
-
that the latter can compute the value of a key programmatically in a global context or in the context of log event.
31
+
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.
33
32
34
33
[#evaluation-contexts]
35
34
== Evaluation contexts
36
35
37
-
Each lookup has an associated prefix,
38
-
and Log4j can evaluate it in one of the following ways:
36
+
Each lookup has an associated prefix, and Log4j can evaluate it in one of the following ways:
39
37
40
38
[#global-context]
41
39
Global context::
@@ -257,8 +255,7 @@ are not supported.
257
255
====
258
256
259
257
Log event context::
260
-
In the context of an event, the Context Map lookup uses the
261
-
Log event
258
+
In the context of an event, the Context Map lookup uses the Log event
<1> Use an **instance** logger field instead of a static one,
552
-
to prevent Log4j Core initialization before `main()` is called.
548
+
<1> Use an **instance** logger field instead of a static one, to prevent Log4j Core initialization before `main()` is called.
553
549
<2> Call `MainMapLookup#setMainArguments` by reflection to allow your application to run with a different Log4j API implementation.
554
550
555
551
* Now you can use `$+{main:...}+` lookups in your configuration file to support the usage of a `--logfile <file>` CLI argument to specify the log file and `--loglevel <level>` CLI argument to specify the log level.
@@ -686,8 +682,7 @@ Spring Boot 2 initializes Log4j Core at least **twice**:
686
682
* Log4j Core is initialized the first time using
687
683
xref:manual/configuration.adoc#automatic-configuration[its own automatic configuration procedure].
688
684
At this point, the lookup will always return `null`.
689
-
Configuration files that use the standard `log4j2.<extension>` naming convention,
690
-
should provide default values for all Spring lookups.
685
+
Configuration files that use the standard `log4j2.<extension>` naming convention, should provide default values for all Spring lookups.
691
686
692
687
* As soon as Spring's `Environment` is ready, the lookup becomes **available** and a reconfiguration is triggered.
693
688
If you want to provide a configuration file specifically for this phase, call it `log4j2-spring.<extension>`.
@@ -732,8 +727,7 @@ of a `StructuredDataMessage`.
732
727
733
728
[TIP]
734
729
====
735
-
Whenever conversion patterns are allowed and `key` is not one of the virtual keys,
736
-
an `$$+{sd:key}+` lookup is equivalent to a
730
+
Whenever conversion patterns are allowed and `key` is not one of the virtual keys, an `$$+{sd:key}+` lookup is equivalent to a
0 commit comments