Repository navigation
Description
Problem
When something goes wrong in the app there is no way to get diagnostics out of it. A user hitting
odd behaviour has nothing to send, and testing on a real phone means the useful detail stays on the
device.
The obvious shape is a Settings action that ships the log somewhere. The catch is that the log a
Release build keeps does not contain the things worth sending.
What the log actually holds today
The file log's minimum level is build-dependent (src/AniSprinkles/MauiProgram.cs):
// Debug
var fileLogMinimumLevel = LogLevel.Debug; // :56
// Release
var fileLogMinimumLevel = LogLevel.Warning; // :67Every trace the app emits is Information:
// DetailsPageModelBase.cs:99
Logger.LogInformation("PageState: {OldState} → {NewState} (key={StateKey})", ...);
// DetailsPageModelBase.cs:306
Logger.LogInformation("NAVTRACE {TracePrefix} load start ({EntityNoun} {Id})", ...);So in a shipped build the file at {AppDataDirectory}/logs holds warnings and errors and nothing
else — no NAVTRACE, no PageState, no CACHE, no AUTH. A share button built today would
faithfully deliver a file missing exactly what makes a report diagnosable.
Retention is 256 KB across 3 rotated files in Release (MauiProgram.cs:69) and 1 MB in Debug
(MauiProgram.cs:58); the 1 MB in FileLoggerProvider.cs:12 is the constructor default that only
Debug passes. So whatever level is chosen, the window is finite — and in Release it is a quarter of
what this issue originally assumed.
Options
Settled at kickoff: none of A/B/C — a fourth shape, D. An in-memory ring buffer
ILoggerProvider holding roughly the last five minutes at Information, bounded by both age and
line count, written to disk only when a global exception handler fires or the activity pauses. A
report bundles the current ring plus the last flushed session. The file log stays at Warning in
Release, unchanged.
D beat B because B pays a write cost on every install and shrinks the already-small 256 KB Release
window. It beat C because, although the full traces are already in logcat at Debug in every build
config (MauiProgram.cs:92-94, so C needed a reader rather than new logging), logcat lives in the
app project where no unit test can reach it and its buffer is shared with the rest of the system. D
lives in Core, so eviction is testable on FakeTimeProvider. It beat A for the reason A already
gives against itself.
The three below are kept for the record.
A. Opt-in verbose toggle. A Settings switch that raises the file-log level to Information while
on. Normal installs keep today's write cost and privacy posture; the user turns it on, reproduces,
sends. The cost is that it must be enabled before the problem happens, which is the wrong order for
anything intermittent.
B. Always persist Information in Release. Traces are always there when needed, and there is no
second step at the worst moment. Every install pays the write cost, and the 1 MB / 3-file window
fills faster, so it holds proportionally less history.
C. Capture the live logcat buffer at share time. Leaves the file log alone and reads Android's
process log when the user taps share. Full traces, no persistent cost — but only covers the current
process, so it dies with a restart, and it is Android-specific in a way the file logger is not.
A and B trade privacy and cost against catching intermittent faults, and C trades durability for
completeness. D takes C's zero-persistent-cost shape and buys back most of the durability with the
handler and pause flushes, at the price of holding the buffer in RAM.
Audience
Both, and they pull differently:
- Testing on a real phone. Wants an artifact immediately, in hand.
- A user reporting a problem. Wants it to reach the maintainer without asking anything of them.
Delivery should attach the log to Sentry, which is already wired and is where crash reports
already land.
Resolved at kickoff: Sentry only, no share-sheet path. Sentry's silence is handled by making the
send explicit at both ends rather than by adding a second delivery route — a popup states what is
about to be collected before anything is sent, and the confirmation names it back ("Diagnostics sent
— last 5 minutes of activity"). The popup also carries an optional free-text box for what the user
was doing, sent as SentryFeedback with AssociatedEventId set to the diagnostic event, so the
description arrives as a linked user report rather than buried in an event body.
Note for implementation: SentryScrubber runs on SetBeforeSend over the SentryEvent and does
not touch attachments, so the bundle has to be redacted where it is built. The free-text
description needs the same pass — a user can paste anything into it.
Constraint
- Bearer-token redaction is bypassed for the log file and Sentry #124 has landed.
ErrorReportServicepreviously redacted Bearer tokens from the string shown
in the UI but handed the raw exception toILoggerand Sentry, andAniListClientembeds up to
500 characters of raw response body in exception messages — so the log could carry an unredacted
credential. That was the blocker on this issue and it is now closed. Re-verify the redaction holds
on whichever path ships, because this feature turns a passive leak into an active one. - A real user's log is their data. List contents, media ids, and account identifiers can all
appear. Whatever ships should be clear about what is being sent. - File-log retention is 256 KB / 3 files in Release. Raising the level would shorten the history
the user can send, which is part of why the ring buffer is separate from it.
Related
- Bearer-token redaction is bypassed for the log file and Sentry #124 — Bearer-token redaction. Closed; was the hard dependency here.
- UI tests: nothing can catch page-lifecycle bugs on pushed detail pages #131 / CI stubs: details-page paging and userPreferred are too static to catch regressions #134 — the other two "we cannot see what the app is doing" gaps, from the test side.
Activity
zhollis21 commentedon Aug 22, 2026
Dependency worth knowing about before this ships: #124.
ErrorReportServiceredacts Bearer tokens out of the string it returns to the UI, but hands the raw exception toILoggerand Sentry — so the rotating file log this issue proposes sharing can contain unredacted tokens.AniListClientembeds up to 500 characters of the raw HTTP response body into exception messages, so an auth-failure body that echoes the credential reaches the log.Passive today. A share button would make it active exfiltration, so #124 should land first.
Separately, the observation in this issue's own framing still stands and is worth re-checking during implementation: Release persists only
Warningand above while every trace in the app (NAVTRACE,PageState,CACHE,AUTH) isInformation, so the shipped button would deliver a file missing exactly what makes a report useful.[-]Enable Diagnostic Logging[/-][+]No way to get diagnostics off a device, and Release logs only warnings anyway[/+]zhollis21 commentedon Sep 2, 2026
Verification notes from kickoff, against
origin/main@0fa0729. Facts only.Retention figure in the body has drifted. Release passes 256 KB / 3 files, not 1 MB
(
MauiProgram.cs:69). The 1 MB inFileLoggerProvider.cs:12is the constructor default, and onlyDebug passes it (
MauiProgram.cs:58). So the Release window is a quarter of what this issue assumes.The full traces already reach logcat in every build config.
AndroidLogcatLoggerProviderisregistered unconditionally at
LogLevel.Debug(MauiProgram.cs:92-94), with a comment saying soexplicitly.
NAVTRACE,PageState,CACHEandAUTHare all in the Android log buffer of aRelease build right now — what is missing is capture and delivery, not the data. That changes the
cost of option C: it needs no new logging, only a reader.
The app is Android-only —
<TargetFrameworks>net10.0-android</TargetFrameworks>(
AniSprinkles.csproj:4). Option C's "Android-specific" cost is not a cost against today's targets.#124 is closed (2026-08-24). Redaction is
SensitiveText.Redactapplied at the source inAniListClient, plusSentryScrubberonSetBeforeSend(MauiProgram.cs:36). Note the asymmetry:the scrubber only sees Sentry events. The file log and logcat have no sink-side pass, so they depend
entirely on source-side redaction holding.
The log sinks carry more URI than the breadcrumbs do.
LoggingHandlerlogs the fullRequestUri(LoggingHandler.cs:34,:50), while the matching Sentry breadcrumb trims toGetLeftPart(UriPartial.Path)(:35). Anything in a query string is in the file log and logcat butnot in Sentry.
A
NotFoundfailure currently produces the least evidence of any error path:Warning, deliberately not sent to Sentry (DetailsPageModelBase.cs:348-353)detailsis suppressed tostring.Empty(DetailsPageModelBase.cs:369)ErrorStateView's Copy and Share are gated onHasErrorDetails(ErrorStateView.xaml.cs:115,:132), so the error card for a NotFound has no share affordance at allClassifyGraphQlErrormaps any message containing "Not Found" toApiErrorKind.NotFoundandnon-retryable (
AniListErrorClassifier.cs:56)Sentry breadcrumbs are already broadly instrumented — navigation, HTTP, auth, and list actions
across
MediaListPageModel,MediaDetailsPageModel,SettingsPageModel,EntryActionCoordinatorand
DetailsPageModelBase. Any explicitCaptureMessageinherits that trail.Settings' content is gated on sign-in.
SettingsLoadedContentViewis only attached whenIsAuthenticated && CurrentState == Content(SettingsPage.xaml.cs:148-149), so anything placedinside it is unreachable while signed out. The signed-out branch lives in
SettingsPage.xaml:34-58.Existing share precedent:
Share.Default.RequestAsync(new ShareTextRequest ...)inErrorStateView.xaml.cs:134-139.Related open issues in the same area: #149 (airing worker's faults reach only logcat) and #156
(unhandled Android exceptions swallowed silently).
zhollis21 commentedon Sep 3, 2026
Updated during planning:
MauiProgram.cs:69), not the 1 MB the body claimed. That 1 MB isFileLoggerProvider.cs:12's constructor default and only Debug passes it.Information, flushed to disk only on the global exception handlers and on activity pause, with the file log left atWarning. Reasoning recorded in the body.SentryFeedbacklinked to the diagnostic event.Also in scope for the same PR, tracked separately: the
NotFoundpath currently produces no Sentry event, no details string, and therefore no Copy/Share affordance on the error card, so the exact failure that prompted this work is the one nothing can report.zhollis21 commentedon Sep 3, 2026
Filed #158 for the NotFound blind spot. Same PR, but tracked separately so the diagnostics pipeline and the error-path fix each have their own record.
Send the last five minutes of activity from the device, and stop NotF…