Although LoggingEvent#getFormattedMessage() isn't public (#28), its code is still usable as a reference. However, it doesn't present null values the same way as SLF4J, due to un-matched wrapping/unwrapping of Optional:
LoggingEvent e = new LoggingEvent(Level.INFO, "Content: {}, {}", null, "value");
System.out.println(MessageFormatter.arrayFormat(e.getMessage(), e.getArguments().toArray()).getMessage());
Although
LoggingEvent#getFormattedMessage()
isn't public (#28), its code is still usable as a reference. However, it doesn't presentnull
values the same way as SLF4J, due to un-matched wrapping/unwrapping ofOptional
:Produces:
Rather than the expected: