ppkarwasz opened a new pull request, #4368: URL: https://github.com/apache/logging-log4j2/pull/4368
If a log event cannot be serialized, `SerializedLayout.toByteArray` logs an error, but it still returned the bytes written up to the failure, so a truncated, unreadable record ended up in the output. It now returns an empty array, so nothing is written for that event. Pointed out by @ramanathan1504 in https://github.com/apache/logging-log4j2/pull/4271#issuecomment-5574018672. The new `SerializedLayoutTest.testSerializationFailure` uses a log event with a non-serializable field: without the fix, the layout returns 5151 bytes of partial output. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
