Skip to content

feat(android): [Logs and Metrics Enable Flags 5] Add Logcat Logs opt-in - #5945

Open
adinauer wants to merge 2 commits into
feat/logs-opt-in-timberfrom
feat/logs-opt-in-logcat
Open

feat(android): [Logs and Metrics Enable Flags 5] Add Logcat Logs opt-in#5945
adinauer wants to merge 2 commits into
feat/logs-opt-in-timberfrom
feat/logs-opt-in-logcat

Conversation

@adinauer

@adinauer adinauer commented Aug 12, 2026

Copy link
Copy Markdown
Member

PR Stack (Logs and Metrics Enable Flags)


📜 Description

Adds SentryAndroidOptions.enableLogcatLogs, defaulting to false, and the io.sentry.logcat.logs.enabled Android manifest key.

SentryLogcatAdapter now requires both this local opt-in and the existing aggregate core Logs flag before forwarding Logcat calls as Sentry Logs. The local check runs before throwable and message processing. Breadcrumb creation and the original Android Log invocation remain unchanged.

💡 Motivation and Context

Automatic Logcat instrumentation needs an explicit local opt-in before the aggregate core Logs flag can be removed. This prevents instrumented Android applications from unexpectedly forwarding Logcat output when core Logs capture becomes available without a global enable flag.

💚 How did you test it?

  • ./gradlew spotlessApply apiDump
  • ./gradlew :sentry-android-core:testReleaseUnitTest
  • Added tests for Java and manifest opt-in, default-disabled behavior, and independent breadcrumb and Android Log calls
  • Preserved coverage for Logcat levels, throwable bodies, and origin

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Add the Spring Boot Logback opt-in before removing the aggregate core Logs flag.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

adinauer and others added 2 commits August 12, 2026 16:28
Require an explicit Android option before forwarding Logcat calls as Sentry Logs. Support Java and manifest configuration while keeping breadcrumbs and Android Log calls unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against c432ec5

@sentry

sentry Bot commented Aug 12, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.52.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 336.49 ms 419.88 ms 83.39 ms
Size 0 B 0 B 0 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant