feat(logback): [Logs and Metrics Enable Flags 1] Add Logs opt-in - #5940
Open
adinauer wants to merge 2 commits into
Open
feat(logback): [Logs and Metrics Enable Flags 1] Add Logs opt-in#5940adinauer wants to merge 2 commits into
adinauer wants to merge 2 commits into
Conversation
Require an explicit Logback appender opt-in before forwarding records as Sentry Logs. Keep event and breadcrumb capture independent while the aggregate core Logs flag remains in place. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
8 tasks
📲 Install BuildsAndroid
|
This was referenced Aug 12, 2026
runningcode
approved these changes
Aug 13, 2026
runningcode
left a comment
Contributor
There was a problem hiding this comment.
I put a global suggestion on the naming, probably worth a discussion with the team but otherwise going to approve
| public fun getMinimumBreadcrumbLevel ()Lch/qos/logback/classic/Level; | ||
| public fun getMinimumEventLevel ()Lch/qos/logback/classic/Level; | ||
| public fun getMinimumLevel ()Lch/qos/logback/classic/Level; | ||
| public fun isEnableLogs ()Z |
Contributor
There was a problem hiding this comment.
would it be more idiomatic to make this logsEnabled()?
Member
Author
There was a problem hiding this comment.
Afaik other SDKs are calling the option enableLogs too, so I wanted to align.
Contributor
There was a problem hiding this comment.
good point, this is the classic tension of consistency vs feeling native to the platform. Given our new goal hierarchy, I would think it should be the one that feels native.
| public fun getMinimumEventLevel ()Lch/qos/logback/classic/Level; | ||
| public fun getMinimumLevel ()Lch/qos/logback/classic/Level; | ||
| public fun isEnableLogs ()Z | ||
| public fun setEnableLogs (Z)V |
Contributor
There was a problem hiding this comment.
same suggestion as above
Suggested change
| public fun setEnableLogs (Z)V | |
| public fun setLogsEnabled (Z)V |
| private @NotNull Level minimumBreadcrumbLevel = Level.INFO; | ||
| private @NotNull Level minimumEventLevel = Level.ERROR; | ||
| private @NotNull Level minimumLevel = Level.INFO; | ||
| private boolean enableLogs = false; |
Contributor
There was a problem hiding this comment.
Suggested change
| private boolean enableLogs = false; | |
| private boolean logsEnabled = false; |
adinauer
marked this pull request as ready for review
August 13, 2026 13:40
adinauer
requested review from
0xadam-brown,
markushi and
romtsn
as code owners
August 13, 2026 13:40
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
enableLogsoption to the LogbackSentryAppender. The option defaults tofalseand can be configured through Java or Logback XML.The appender now requires both this local opt-in and the existing aggregate core Logs flag before forwarding Logback records as Sentry Logs. 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. This prevents applications from unexpectedly forwarding framework logs when core Logs capture becomes available without a global enable flag.
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry-logback:test📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Continue adding integration-local Logs opt-ins before removing the aggregate core Logs flag.