If possible, upgrade to Log4j version 2.15.0.
If upgrading is not possible, then ensure the -Dlog4j2.formatMsgNoLookups=true system property is set. Use the this command:
java -Dlog4j2.formatMsgNoLookups=true -jar myapp.jar
Also worth reading on mitigation: