**Repro line**:
```
./gradlew ':server:test' --tests "org.elasticsearch.common.logging.LoggersTests" -Dtests.iters=2
```

**Reproduces locally?**:
yes

**Applicable branches**:
master, more?

server/src/test/java/org/elasticsearch/common/logging/LoggersTests.java
public void testParameterizedMessageLambda() throws Exception {
        final MockAppender appender = new MockAppender("trace_appender");
        appender.start();
        final Logger testLogger = LogManager.getLogger(LoggersTests.class);
        Loggers.addAppender(testLogger, appender);
        Loggers.setLevel(testLogger, Level.TRACE);
        Throwable ex = randomException();
        testLogger.error(() -> new ParameterizedMessage("an error message"), ex);
        assertThat(appender.lastEvent.getLevel(), equalTo(Level.ERROR));
        assertThat(appender.lastEvent.getThrown(), equalTo(ex));
        assertThat(appender.lastParameterizedMessage().getFormattedMessage(), equalTo("an error message"));
        ex = randomException();
        testLogger.warn(() -> new ParameterizedMessage("a warn message: [{}]", "long gc"), ex);
        assertThat(appender.lastEvent.getLevel(), equalTo(Level.WARN));
        assertThat(appender.lastEvent.getThrown(), equalTo(ex));