Documentation

Live Logs

Watch trace events arrive in real time.

Overview

The Live Logs view displays a real-time stream of trace events as they arrive from the TraceLLM WebSocket. Every time a trace is created, updated, or persisted, a trace.created event is broadcast to all connected clients — including this view, the CLI monitor, and any other WebSocket subscribers.

WebSocket Connection

The live logs connect to the backend WebSocket at ws://127.0.0.1:8000/ws. On connection, the server sends a system.connected message. Clients can send {"type": "ping"} messages to which the server responds with {"type": "system.pong"}.

WebSocket protocolCopy
json
// Server → Client (on connect)
{
  "type": "system.connected",
  "status": "connected",
  "message": "TraceLLM websocket active"
}

// Server → Client (on trace creation)
{
  "type": "trace.created",
  "trace": { ... }  // Full TraceSchema object
}

// Client → Server (heartbeat)
{ "type": "ping", "ts": 1717151234 }

// Server → Client (heartbeat response)
{ "type": "system.pong", "timestamp": 1717151234 }

Log Entries

Each incoming trace event is displayed as a log entry showing:

  • Timestamp of receipt
  • Trace ID
  • Status badge (success/warning/failed)
  • Model name
  • Latency and token count
  • Prompt preview (first 80 characters)

Tip

The live logs view is useful for monitoring production systems in real time. Combine it with the CLI monitor for a terminal-based alternative.

Auto-Reconnect

The WebSocket client implements automatic reconnection with exponential backoff from 1 to 30 seconds. If the backend restarts or the network drops, the dashboard automatically reconnects once the service is available again.

Warning

Logs accumulated while disconnected are not retroactively fetched. Only events broadcast after reconnection appear in the live stream. For historical data, use the Traces view or the Analytics view.