Skip to content

Send logcat through Sentry Logs #4487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 7, 2025
Merged

Send logcat through Sentry Logs #4487

merged 15 commits into from
Jul 7, 2025

Conversation

stefanosiano
Copy link
Member

📜 Description

SentryLogcatAdapter now forwards output to Sentry Logs, if enabled

💡 Motivation and Context

Closes #4408

💚 How did you test it?

📝 Checklist

  • 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

Copy link
Contributor

github-actions bot commented Jun 12, 2025

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

Generated by 🚫 dangerJS against 4a90aba

Copy link
Contributor

github-actions bot commented Jun 12, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 336.43 ms 377.71 ms 41.29 ms
Size 1.58 MiB 2.09 MiB 518.94 KiB

Previous results on branch: feat/logcat-sentry-logs

Startup times

Revision Plain With Sentry Diff
2e00745 440.67 ms 489.81 ms 49.14 ms
296205e 397.86 ms 416.63 ms 18.77 ms
229d937 407.06 ms 448.72 ms 41.66 ms
d035656 399.04 ms 416.73 ms 17.69 ms
771a432 410.52 ms 458.84 ms 48.32 ms

App size

Revision Plain With Sentry Diff
2e00745 1.58 MiB 2.09 MiB 518.68 KiB
296205e 1.58 MiB 2.09 MiB 518.67 KiB
229d937 1.58 MiB 2.09 MiB 518.93 KiB
d035656 1.58 MiB 2.08 MiB 511.32 KiB
771a432 1.58 MiB 2.08 MiB 511.32 KiB

@stefanosiano stefanosiano marked this pull request as ready for review June 13, 2025 09:28
@ishanzuaim
Copy link

Hi, this is a feature I am quite keen on, so just dropping some useful (easy to add?) additions

  • Automatically include the log tag as an attribute of the log event
  • Introduce a config option where the minimum log level can be set

@stefanosiano
Copy link
Member Author

hi @ishanzuaim, and thanks for the interest!

You can already set the minimum logging level in the gradle plugin options following the logcat integration documentation

sentry {
  tracingInstrumentation {
    ...
    logcat {
      enabled = true
      minLevel = LogcatLevel.WARNING
    }
  }
}

We'll discuss how to best send the tag in the logs, too!

# Conflicts:
#	CHANGELOG.md
#	sentry-android-core/src/test/java/io/sentry/android/core/InternalSentrySdkTest.kt
#	sentry-android-core/src/test/java/io/sentry/android/core/SentryLogcatAdapterTest.kt
Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, please check internally regarding attaching the stacktrace.

@stefanosiano stefanosiano enabled auto-merge (squash) July 7, 2025 09:15
@stefanosiano stefanosiano merged commit bc15877 into main Jul 7, 2025
34 checks passed
@stefanosiano stefanosiano deleted the feat/logcat-sentry-logs branch July 7, 2025 09:21
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.

Integration for Sentry Logs through Logcat
5 participants