Repository navigation
Closed
Labels
Description
Events from Android can send device logcat logs as attachments.
The current preview format shows it as standard text. We'd like to be able to see the logs in a more user friendly way.
For example, with process/ priority and timestamp filter, coloring, etc.
For example, the logcat window inside Android Studio:
Solution brainstorming
Add to the current handlers one called text/logcat:
sentry/static/app/components/events/eventAttachments.tsx
Lines 38 to 56 in d4f5584
| const getInlineAttachmentRenderer = (attachment: IssueAttachment) => { | |
| switch (attachment.mimetype) { | |
| case 'text/plain': | |
| return attachment.size > 0 ? LogFileViewer : undefined; | |
| case 'text/json': | |
| case 'text/x-json': | |
| case 'application/json': | |
| if (attachment.name === 'rrweb.json' || attachment.name.startsWith('rrweb-')) { | |
| return RRWebJsonViewer; | |
| } | |
| return JsonViewer; | |
| case 'image/jpeg': | |
| case 'image/png': | |
| case 'image/gif': | |
| return ImageViewer; | |
| default: | |
| return undefined; | |
| } | |
| }; |
Use an npm library that parses the output to display the preview with field on top.
More context on this PR/thread: getsentry/sentry-dotnet#2926 (comment)
Reacted by Reinaldy Rafli
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsNo status
Activity
[-][Event Detail]: Attachment preview for logcat output[/-][+][Event Detail]: Attachment preview for Android logcat output[/+]kanadaj commentedon Dec 2, 2023
Here is a sample log file:
So the standard format is basically
and multi-line messages have this header on each line. Some lines may begin with a series of hyphens to signify a separator, these should probably be unparsed. Levels are:
Managed C# stack traces from .NET Android follow mostly the same format as Java stacktraces with the exception that they have the arguments instead of the file and line number:
Java:
C#:
so it's also possible to highlight lines with stacktrace lines via
where
{Details}is{Filename}:{Line}for Java stacktraces and a comma separated list of{Type}[ {ParamName}]args with optional ParamName for C#. I assume the same can be done for React Native as well.getsantry commentedon Dec 5, 2023
Routing to @getsentry/product-owners-issues for triage ⏲️
bruno-garcia commentedon Oct 20, 2024
Since this issue will celebrate 1 year birthday, I raise a simpler one so we can at least see them as flat file:
bruno-garcia commentedon Aug 9, 2025
Since we're adding logs as a first class citizen, I don't think this is worth the effort.