GitHub user rgoers edited a comment on the discussion: Removing 
`StructuredDataMessage` and all other RFC 5424 et al.

I would suggest fixing StructuredDataMessage. First, add a StructuredData 
element that contains the SD-ID and the key/value pairs.  Then modify 
StructuredDataMessage with a constructor that accepts List of 
StructuredDataElements and a String message. I would deprecate the existing 
constructors in 2.x and remove them in 3.x.  I would then modify 
StructuredDataMessage accordingliy.

Since StructuredDataMessage should extend MapMessage I would suggest that when 
acting as a MapMessage the maps of the StructuredDataMessages be merged and 
their keys be prefixed with the SD-ID value followed by ":".  The message 
should be stored in a key with the value "message" in the MapMessage map. I 
would then modify RFC5424Layout to leverage this structure. Everything else 
should treat it as a MapMessage. 

StructuredDataCollectionMessage should be deprecated in 2.x and removed in 3.x. 
It makes no sense.

GitHub link: 
https://github.com/apache/logging-log4j2/discussions/4140#discussioncomment-17166743

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to