liveBook · Manning

Log

As explained in Designing AI Systems

The recording of application or system events, diagnostics, and operational information.

Structured logs record service events in a common, queryable format. In AI systems, events can include model names, token counts, costs, fallback chains, guardrail results, and retrieval scores alongside standard correlation IDs. section 7.4.1

Trace and span IDs connect events across services, letting operators retrieve the logs for a request and investigate slow or problematic spans. Attribute filters support targeted queries; cursor-based pagination handles large result sets. Use pseudonymized user IDs where required, and set retention policies because log storage grows continuously. section 7.4.1

Listing 7.2 Structured log event Protocol Buffer definition
message LogEvent {
  string event_id = 1;
  string trace_id = 2;    #A
  string span_id = 3;    #A
  google.protobuf.Timestamp timestamp = 4;
  string service = 5;
  Severity severity = 6;
  string event_type = 7;    #B
  string message = 8;
  map<string, string> attributes = 9;    #C
  map<string, double> numeric_attributes = 10;    #C
  string workflow_id = 11;
  string user_id = 12;
}

The event schema includes identifiers, timestamp, service, severity, event type, message, flexible attributes, and workflow and user IDs. section 7.4.1

Recording a provider fallback

A fallback event can record warning severity, the original and fallback providers, the error type, and the request’s trace and span IDs. section 7.4.1

Platform services can emit structured telemetry automatically, while an observability client batches and buffers delivery so publishing does not slow user requests. section 7.5

How Designing AI Systems covers it

How deep it goes
Defines a shared event schema and operational query, privacy, and retention practices.
Examples
Uses provider-fallback events, trace-filtered investigations, and guardrail-policy attribute queries.
What you can do after
Diagnose slow or anomalous requests by retrieving correlated events and filtering their attributes.
How it connects
Links structured logs with distributed tracing, guardrail evaluation, and AI-specific metrics.

Also explained in

Compare how 21 books explain log →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Designing AI Systems. The section links point to the parts of the book it draws on.