-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

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest