ppkarwasz commented on PR #4103:
URL: https://github.com/apache/logging-log4j2/pull/4103#issuecomment-4338457806

   Hi @DrDrunkenstien-10,
   
   Thank you for the contribution, the Javadoc improvement is very appreciated! 
:heart:
   
   However, since we'll be preparing a new minor version soon, I think we can 
push this further: throw an `IllegalArgumentException`, whenever a user passes 
an invalid argument. This is already true, whenever a user calls one of the 
`with(...)` methods on this class: the key is checked for compliance with 
RFC5424. We could have exactly the same behavior for `id` and `type` (BTW: it 
would be useful to rename them to `sdId` and `msgId`).
   
   Regarding the recommendation of using `StructuredDataId`, we should add a 
reason:
   
   > `StructuredDataId` allows you to specify the list of allowed keys
   
   While the above is true, there seems to be another small problem in the 
code: the possible fields specified by `StructuredDataId` are never actually 
checked. :wink:


-- 
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