ppkarwasz commented on issue #1414:
URL: 
https://github.com/apache/logging-log4j2/issues/1414#issuecomment-1748852847

   @AlexxeyKa,
   
   The API breakage in `2.19.0` was unintentional and we'll revert it in the 
`2.x` branch. As for the `3.x` branch I would keep the class hidden.
   
   The reasons behind this are largely explained in #770: using markers to 
convey additional data is IMHO a hack to workaround SLF4J's limitations. Unlike 
the Log4j API that allows to log any kind of 
[`Message`](https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/message/Message.html),
 for a very long time SLF4J only allowed to log `String`s (or the equivalent of 
[`ParameterizeMessage`](https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/message/ParameterizedMessage.html)).
   
   The situation changed with the release of SLF4J 2.x:
    * using 
[`LoggingEventBuilder#addKeyValue`](https://www.slf4j.org/api/org/slf4j/spi/LoggingEventBuilder.html#addKeyValue-java.lang.String-java.lang.Object-)
 you can attach any kind of additional data to the logging event.
    
    As discussed in #1813 the bridges between SLF4J and Log4j API will 
(probably) map 
[`KeyValuePair`](https://www.slf4j.org/api/org/slf4j/event/KeyValuePair.html)s 
to entries in a 
[`MapMessage`](https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/message/MapMessage.html)
 and viceversa.
    
    @rgoers, am I missing something?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to