CHAPTER 15 · Observability and Evaluation · 4 / 7
Logging discipline
Even with a fancy platform, basic logging hygiene matters:
- Structured, not free-text. Log key-value fields (turn id, tool, document id, duration) so logs are queryable.
- Context on every error. A failure log should say which turn, which tool, which resource, and the error: enough to diagnose without reproducing.
- Never log secrets (Chapter 12) or sensitive document content; scrub them.
- Log decisions, not just outcomes. "Routed to mid-tier model because user has only a Gemini key" is more useful than "called Gemini."