Agent logs can explain execution, but operators also need to know whether customer work was authorized, attempted, confirmed, or left uncertain. Add business events with explicit meaning instead of relying on free-text messages such as “booking done.”
LiveKit documents custom diagnostic context in its job-lifecycle guide and collection paths in its logging guide. Verify SDK-specific support before implementation. The event design below is application policy, not a built-in guarantee of business completion.
Define a small event vocabulary
Useful proposed events include request captured, identity unresolved, action authorized, action submitted, remote outcome verified, reconciliation required, and handoff accepted. Give each a precise definition and responsible producer.
Include verified client scope, environment, session reference, request and action identifiers, event time, schema version, and result category. Use controlled references to sensitive source records rather than copying full transcripts or credentials into ordinary diagnostics.
Work through a fictional booking timeline
A caller requests a visit and the application persists an authorized intent. It submits creation, receives no conclusive response, and records reconciliation required. A later process discovers the remote appointment and records the verified result with its identifier.
The timeline should preserve that sequence. It should not replace the uncertainty event with a generic success message that suggests the caller heard confirmed information during the original conversation.
| Event fixture | Required meaning |
|---|---|
| Request captured | Durable intake exists |
| Action authorized | Approved scope recorded |
| Action submitted | Remote attempt made, not yet proven complete |
| Outcome uncertain | Reconciliation needed |
| Outcome verified | Destination evidence supports result |
Design logs for joins and safe review
Stable identifiers let traces, application events, and remote records connect without duplicating personal content everywhere. Preserve event time separately from collection time so delayed forwarding does not distort the sequence.
Structured events improve search and reporting but require schema ownership and compatibility. Excessive detail creates noise and sensitive copies. Start with consequential state transitions and a documented interpretation that operators can use.
Test missing context, duplicate event delivery, delayed events, and a failed log destination. Critical customer state should remain durable even when log forwarding is unavailable. Review action audits for a related intent-versus-result model.
Questions about business logging
Can a log line be the only durable booking record?
Use a deliberate application record for consequential state. Diagnostic retention and delivery may not meet recovery needs.
Should events contain the full tool payload?
Include only what the approved purpose requires and protect sensitive content through controlled access and retention.
What should a schema change include?
Updated definitions, producer and consumer compatibility, dashboard changes, test fixtures, and a clear version so old events remain interpretable.