
AI logging: what to capture around a model request
Trace a model request through timings, retries, tool calls, configuration changes, and outcomes without collecting every message.
Read AI logging: what to capture around a model requestAI Logging / Field guide
AI logging gives model-driven workflows an inspectable history. Follow application operations, distinguish attempts from completed work, and keep sensitive content out of routine telemetry unless there is a defined reason to capture it.

Start with the purpose
An AI application contains more than a model call. It may retrieve context, invoke a tool, retry a request, stream a result, or hand work to another component. Logging becomes easier to reason about when each of those boundaries has an explicit owner and a clearly named outcome.
Begin with metadata that answers an operational question: the logical operation, the request correlation key, the model configuration reference, observed duration, outcome, and reported usage when it is available. Treat these as design candidates. A field belongs in the record because someone can explain how it will be used, not because an SDK made it easy to collect.
Client-observed timings describe what the application saw. They do not automatically reveal a provider’s internal processing stages. Similarly, a successful transport response does not establish that an answer was useful. Separate request health from quality review, and record the evaluation method whenever you attach a quality assessment.
Prompt and response content require a separate decision from routine metadata. Establish purpose, access, review, and removal rules before enabling a content capture path. A sanitized synthetic example can often answer a development question without preserving a real interaction. Keep the choice visible in the schema and in the operator’s workflow.
Standards and instrumentation evolve. Pin the conventions used by an integration and record migration decisions so that a later field rename does not silently change a report. The AI logging guide works through event boundaries; the token guide covers the narrower accounting questions that arise once usage enters the picture.
Four decisions to make
Keep a logical operation identifier and an attempt number so retries remain visible without becoming duplicate business outcomes.
Name timing and status fields after the boundary you actually observe. Record estimates as estimates.
Choose routine metadata separately from prompts, responses, retrieved documents, or tool payloads.
Track operational completion separately from the human or automated review that judges an answer’s usefulness.

Trace a model request through timings, retries, tool calls, configuration changes, and outcomes without collecting every message.
Read AI logging: what to capture around a model request
Build interpretable LLM usage records with clear totals, missing-value handling, deduplication, and transparent cost estimates.
Read Token usage logging without storing secretsStart with the fundamentals, then follow the signal that matters to your work.