Skip to content

Native events don't have logcat attachments #4845

Open

Description

@jamescrosswell

Description

originally reported by @albyrock87 at #3461 (comment)

Since #3694 had been reverted, this issue should be reopened, we're still getting native crashes without logcats which is the most interesting situation in which we'd like to see the logcat.

Activity

  1. linear commented on Jan 18, 2026

    @linear
  2. added
    BugSomething isn't working
    and removed on Mar 20, 2026
  3. jamescrosswell commented on May 20, 2026

    @jamescrosswell
    CollaboratorAuthor

    If it's a native excepion (which a SIGSEGV is), I think the attachment has to be added when the exception is captured by the sentry-native SDK.

    On Android, sentry-dotnet doesn't include sentry-native directly... only indirectly (since we include sentry-java and sentry-java includes sentry-native).

    sentry-native itself won't know about LogCat, since it's not android specific (it's a native SDK). So I think for this to work, the sentry-java SDK would need to register some kind of BeforeSendCallback withe the sentry-native SDK and inside that callback it could add the logcat attachments.

    If I've got all of that right, it sounds like that requires work and coordination across a few different repositories... so might be tricky but not impossible!e

    @jpnurmi would be interested to get your take on this.

  4. jpnurmi commented on May 20, 2026

    @jpnurmi
    Collaborator

    I tried quickly searching in sentry-java/android but didn't find any logcat.log attaching there. Is it something that only sentry-dotnet does/did?

    In principle, I wouldn't mind having a simple logcat integration in sentry-native because this sounds very useful for all consumers. We should probably align the feature across different SDKs, though?

    My main concern with extracting logcat at native crash time would be whether it's doable with async signal-safe code. Although at the same time, we're experimenting with an out-of-process crash handler for Android (getsentry/sentry-native#1725), which would make it safe to extract logcat.

  5. jamescrosswell commented on May 20, 2026

    @jamescrosswell
    CollaboratorAuthor

    In .NET there's:

    But I don't think that will work for unhandled exceptions that crash the process. It might not be possible to do this before the process crashes but presumably the logs would still be there once the process started up again... so might be possible to grab the logs then.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeBlockedBugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions