Skip to content

feat: redact what every sink writes, exception text included - #8

Merged
crazeydave merged 2 commits into
mainfrom
feat/redact
Oct 28, 2026
Merged

crazeydave merged 2 commits into
mainfrom
feat/redact

Conversation

@crazeydave

Copy link
Copy Markdown
Contributor

An app passes Redact (on InventoryOptions / InventoryMauiOptions): given any text, the same text with what must not be logged replaced.

  • A RedactingEnricher is added after Inventory's own enrichers, so it reaches the exception fields (ExceptionMessage, ExceptionInnerChain, …) and the log context, which an enricher in Configure cannot.
  • A RedactingSink sits in front of every sink — local files, logcat, the holding and shipping Better Stack sinks — and hands on a RedactedException whose ToString() is the original's, redacted. Its type, message and stack read as they did.
  • Null (the default) changes nothing.

For Register's email redaction: today its enricher runs in Configure, so addresses in exception text reach Better Stack as they were.

Tests: RedactionTests (enricher, sink, WriteToRedacted), and a LogShipperTests case that a shipped event's exception is redacted. README has a Redaction section.

An app passes Redact; a RedactingEnricher added after Inventory's own
enrichers reaches the exception fields and log context, and a
RedactingSink in front of each sink hands on the exception's text
redacted.
@crazeydave
crazeydave merged commit 5fcf558 into main Oct 28, 2026
5 checks passed
@crazeydave
crazeydave deleted the feat/redact branch October 28, 2026 17:02
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