fix(jul): [Logs and Metrics Enable Flags 17] Preserve null-message records - #5960
Open
adinauer wants to merge 4 commits into
Open
fix(jul): [Logs and Metrics Enable Flags 17] Preserve null-message records#5960adinauer wants to merge 4 commits into
adinauer wants to merge 4 commits into
Conversation
Skip only Sentry Logs conversion when a valid JUL record has no message, allowing its event and breadcrumb capture paths to continue. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Aug 13, 2026
adinauer
commented
Aug 13, 2026
|
|
||
| final @NotNull String formattedMessage = maybeFormatted(arguments, message); | ||
|
|
||
| if (!formattedMessage.equals(message)) { |
Member
Author
There was a problem hiding this comment.
This would be causing a NullPointerException. This PR fixes that.
📲 Install BuildsAndroid
|
8 tasks
Contributor
Performance metrics 🚀
|
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Logs and Metrics Enable Flags)
📜 Description
Skips Sentry Logs conversion when a valid JUL
LogRecordhas a null message. Event and breadcrumb processing continues normally, while no invalid Sentry Log item is created.💡 Motivation and Context
JUL permits null messages. When Sentry Logs forwarding was enabled,
captureLogdereferenced the null formatted message before the established event and breadcrumb branches ran. The enclosing error handler then aborted processing, dropping an otherwise valid event or breadcrumb.The issue is specific to JUL's nullable
LogRecordpath. Logcat and Timber already handle nullable bodies explicitly, Logback does not dereference its nullable formatted message in this path, and standard Log4j2 message implementations provide a formatted string.💚 How did you test it?
./gradlew :sentry-jul:test./gradlew spotlessApply apiDump📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.
#skip-changelog