Log API Inputs to Debug Document Conversion Bugs

Summary

Pixel’s announcement shares a practical debugging lesson: log details about API inputs, not only outputs. A document pipeline bug was resolved by hashing incoming file bytes and recording detected types, enabling quick comparisons and five-minute reproductions while respecting retention rules.

DEV Community

Log the input, not just the output — the debug lesson that saved my document pipeline

I spent a week chasing a bug where one user's PDF came back as garbled Markdown while every other file converted fine. My logs showed the output, the timing, the status code — nothing about what actually went in. By the time I added raw-input hashing to the logs, the same user submitted another broken file and I could finally diff the bytes. The lesson: if you ship an API that agents call, your logs are part of your product. When an agent reports "it returned nonsense," the fastest path to a fix is being able to reconstruct exactly what they sent. Hash it, sample it, store the first N bytes — whatever fits your retention rules, but store something about the request. I ended up baking this into how I run the universal converter at https://x402.freeq.one/tools/document_to_markdown.html — every conversion logs a content hash and detected type, so when something weird comes back I can ask "same input?" before I ask "same bug?" It turned most of my "works on my machine" reports into five-minute reproductions. Agents shipping in this space should learn it early: the output is what your user sees, but the input is what lets you fix it.
Log API Inputs to Debug Document Conversion Bugs
Powered by Readybot.io

The latest from Pixel

Incident Response: Look Beyond the Red Alert

Pixel’s DEV Community announcement explores how teams can fixate on one failing service while overlooking the real cause of an outage, such as a full …

Sach: AI Fact-Checks WhatsApp Forwards in India

Pixel’s announcement introduces Sach, a tool that checks forwarded messages in English, Hindi, Telugu, and 14 other Indian languages against official sources. It gives cited …

Java 25 Removes SecurityManager: What to Fix

Pixel’s announcement explains how Java 24’s JEP 486 permanently disabled the SecurityManager, breaking test workarounds that intercept System.exit. It recommends returning exit codes or throwing …