feat(core): [Logs and Metrics Enable Flags 7] Remove Logs enable flag - #5947
Open
adinauer wants to merge 3 commits into
Open
feat(core): [Logs and Metrics Enable Flags 7] Remove Logs enable flag#5947adinauer wants to merge 3 commits into
adinauer wants to merge 3 commits into
Conversation
Capture manual Sentry Logs without an aggregate enable option and always create the configured logger batch processor. Keep automatic logging integrations controlled by their local opt-ins and remove legacy Logs configuration from active samples and fixtures. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
This was referenced Aug 12, 2026
📲 Install BuildsAndroid
|
2 tasks
This was referenced Aug 13, 2026
Keep the integration-local enableLogs setting while removing the aggregate Logs configuration that no longer exists. Co-Authored-By: Claude <noreply@anthropic.com>
8 tasks
Contributor
Performance metrics 🚀
|
This was referenced Aug 13, 2026
adinauer
marked this pull request as ready for review
August 13, 2026 13:41
Comment on lines
3733
to
3738
| } | ||
| } | ||
|
|
||
| if (options.isEnableLogs() != null) { | ||
| getLogs().setEnabled(options.isEnableLogs()); | ||
| } | ||
|
|
||
| if (options.isEnableMetrics() != null) { | ||
| getMetrics().setEnabled(options.isEnableMetrics()); | ||
| } |
There was a problem hiding this comment.
Bug: The logs.enabled configuration is now parsed but silently ignored, causing logs to be captured even when users have explicitly disabled them.
Severity: MEDIUM
Suggested Fix
To prevent this silent breaking change, either restore the functionality of the logs.enabled flag or add a prominent warning when this deprecated configuration is detected. This will inform users about the change in behavior and guide them on how to properly configure logging going forward, preventing unexpected data capture.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: sentry/src/main/java/io/sentry/SentryOptions.java#L3733-L3738
Potential issue: The `logs.enabled` configuration property is now parsed but silently
ignored. The pull request removes the `enable` field from `SentryOptions.Logs` and the
corresponding `options.getLogs().isEnabled()` checks in `SentryClient` and
`LoggerApi.captureLog()`. As a result, users who have explicitly set
`logs.enabled=false` in their configuration to disable logging will find that logs are
now captured and sent as long as the SDK itself is enabled. This silent breaking change
goes against explicit user configuration and can lead to unexpected data collection and
network usage.
Also affects:
sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java:706~711
Did we get this right? 👍 / 👎 to inform future reviews.
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
Removes
SentryOptions.Logs.isEnabledandsetEnabledand the aggregate Logs gate fromLoggerApi. ManualSentry.logger()calls now capture Logs whenever the SDK is enabled.SentryClientnow always creates the configured logger batch processor. Logback, Log4j2, JUL, Timber, and Logcat continue to require their integration-local opt-ins introduced earlier in this stack.Stops applying the legacy external and Android manifest values while retaining their parsing/accessors and metadata key for migration warnings in the following PRs. Removes active legacy Logs configuration from samples and test fixtures.
💡 Motivation and Context
The aggregate Logs flag duplicates integration-local controls and makes manual structured logging require an unnecessary global opt-in. Removing it gives
Sentry.logger()the same direct capture semantics as other SDK APIs while local integration flags prevent unexpected automatic log forwarding.💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew :sentry:test :sentry-android-core:testReleaseUnitTest./gradlew :sentry-logback:test :sentry-log4j2:test :sentry-jul:test :sentry-android-timber:testReleaseUnitTest./gradlew :sentry-spring-boot:test :sentry-spring-boot-jakarta:test :sentry-spring-boot-4:test📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Add targeted warnings for legacy Android manifest, external, and Spring Boot Logs configuration.