2026-07-15 · 6 min read · Rahul Chitturi
- json
- logs
- debugging
Production logs often contain JSON that is no longer a clean JSON document. The payload may be wrapped inside another JSON field, escaped for a log aggregator, split across lines by a stack trace, or copied with timestamps and request IDs attached. If you paste that entire line into a parser, the error message points at the logging wrapper instead of the API payload you need to inspect.
Treat log debugging as a two-step process: recover the exact value you want to inspect, then format and compare it. That keeps you from changing application parsers when the real problem is how observability tooling serialized the event.
Separate wrappers from payloads
Start by identifying where the useful JSON begins and ends. A log line may have a text prefix, a JSON object with a message field, or a Base64-encoded body embedded in metadata. Remove one layer at a time and keep the original line nearby so you can prove which transformation fixed the syntax.
- Strip timestamp, severity, logger name, and request ID prefixes before parsing
- Unescape stringified JSON only once unless the value is intentionally nested
- Decode Base64 fields after confirming they are payloads, not signatures
- Normalize stack traces separately so they do not corrupt payload diffs
Make comparisons safe and useful
When comparing a failing log line with a known-good request, redact secrets while preserving field shape. Keep IDs, timestamps, and generated hashes consistent enough to show structure, but avoid pasting full tokens or customer payloads into tickets.
Format both examples with the same indentation before diffing. Otherwise escaped newlines, reordered fields, and copied terminal wrapping can create noise that hides the one field or type mismatch that matters.
A Flashman workflow
Use the JSON formatter to validate recovered payloads, the timestamp converter to align log times with incidents, the Base64 tool for encoded fields, and the diff tool to compare sanitized examples side by side.
Because Flashman tools run in the browser, sensitive debugging samples stay local while you clean up the shape enough to share a safe reproduction.