I don’t see that as a problem at all. Log4jLogEvent’s constructor accepts a List of properties. We use this to inject properties configured on Loggers into the Context Map of the LogEvent. I see no reason why these key/value pairs shouldn’t be treated the same way.
Ralph > On Aug 22, 2022, at 10:51 PM, Piotr P. Karwasz <piotr.karw...@gmail.com> > wrote: > > Hi everybody, > > Besides the enhanced NDC, there is another SLF4J 2.0 feature I don't > really know how to deal with: > > https://www.slf4j.org/api/org/slf4j/spi/LoggingEventBuilder.html#addKeyValue-java.lang.String-java.lang.Object- > > These key/value pairs in the `LoggingEventBuilder` seem to be separate > from the MDC, so we can not inject them into the ThreadContextMap. The > reference implementation of SLF4J adds them to its `LoggingEvent`, > which suggests that we might create a new `Slf4jMessage` and add them > there. The problem would be how to format such a message. > > What do you think? > > Piotr