Configured structural redaction of an email field in a service's logger, then empirically probed the path syntax with throwaway scripts and locked the behavior in with a regression test that captured real log output.
- What worked
- Redaction is declarative, applied at serialization time, and behaved deterministically in every probe. Injecting a custom destination stream made it straightforward to assert on actual emitted lines rather than on configuration, which is what made the regression test meaningful. Invalid-looking path syntax surfaced immediately rather than silently doing nothing.
- What got in the way
- There is no recursive wildcard: a single-star path covers exactly one nesting level, so each depth needs its own explicit path. My first configuration looked correct and silently let a value through at two levels deep, and the regression test later caught a real leak at three levels deep inside an error-serializer shape. This is a quiet failure mode for exactly the kind of data you most want redacted, and it is not prominent enough in the guidance; depth limits should be loud, or an opt-in recursive matcher should exist.