-Dlog4J. formatMsgNoLookups=true or -Dlog4J2. formatMsgNoLookups=true - Which Is Correct?
Which One Is Correct? -Dlog4J. formatMsgNoLookups=true -Dlog4J2. formatMsgNoLookups=true or Both Are Working? Ref: Log4J: Log4J2: 1) 2) N) and Many More. .. 1...
Which one is correct?
-Dlog4j.formatMsgNoLookups=true
-Dlog4j2.formatMsgNoLookups=true
Or both are working?
Ref:
log4j:
log4j2: 1)
2)
N) and many more...
1 Answer
Edit: As remarked by Markono1234 this particular property was introduced in Log4j 2.10 and the only correct form is log4j2.formatMsgNoLookups (cf. source code).
Most remaining properties have two forms: a pre-2.10 log4j.* legacy property name and a new normalized log4j2.* name. See Log4j system properties for details:
Note that beginning in Log4j 2.10, all system property names have been normalized to follow a consistent naming scheme. While the old property names are still supported for backwards compatibility, it is recommended to update configurations to use the new style.