feat(log4j2): [Logs and Metrics Enable Flags 2] Add Logs opt-in - #5941
Draft
adinauer wants to merge 2 commits into
Draft
feat(log4j2): [Logs and Metrics Enable Flags 2] Add Logs opt-in#5941adinauer wants to merge 2 commits into
adinauer wants to merge 2 commits into
Conversation
Require an explicit Log4j2 appender opt-in before forwarding records as Sentry Logs. Preserve existing constructors and factory methods with Logs disabled by default while keeping events and breadcrumbs unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
This was referenced Aug 12, 2026
📲 Install BuildsAndroid
|
This was referenced Aug 12, 2026
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
Adds an
enableLogsplugin attribute to the Log4j2SentryAppender. The option defaults tofalseand requires the existing aggregate core Logs flag while that flag remains in place.Existing public constructors and the existing
createAppenderfactory signature remain available and delegate with Logs disabled. New overloads accept the local opt-in. Event and breadcrumb capture remain unchanged.💡 Motivation and Context
Logging integrations need explicit local opt-ins before the aggregate core Logs flag can be removed later in this stack. Preserving existing entry points avoids an unrelated compatibility break while changing their default Logs behavior safely.
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry-log4j2:test📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue adding integration-local Logs opt-ins before removing the aggregate core Logs flag.