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

   > That is, are additional fields the only affected component?
   
   Yes, the additional fields are the only XML elements without an associated 
namespace. All other elements in the 
[`LogEventMixIn`](https://github.com/apache/logging-log4j2/blob/2.x/log4j-core/src/main/java/org/apache/logging/log4j/core/jackson/LogEventMixIn.java)
 are explicitly assigned to the `http://logging.apache.org/log4j/2.0/events` 
namespace.
   
   The issue arises during the serialization of `LogEventWithAdditionalFields`:
   
   
https://github.com/apache/logging-log4j2/blob/138404a4fd61df72cb53c40b85a16d007279229d/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java#L386-L408
   
   It's possible that simply annotating the additional fields with 
`@JacksonXmlProperty(namespace = "http://logging.apache.org/log4j/2.0/events";)` 
would resolve the namespace issue. However, I believe the problem is broader: 
the current `Log4j-events.xsd` schema does not validate **any** log event, even 
those without additional fields.
   
   If there are users who still rely on XML output **and** require schema 
validation, we should consider providing a way for them to extend our schema to 
support custom fields. Otherwise, we should just adapt the test to use XMLUnit 
and go on.
   


-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to