Skip to main content
This page requires Python familiarity. It covers structured logging from Python functions.
conv.log lets your function write small, structured log entries that show up in Conversation Review → Diagnosis and in the Conversations API. Use it for breadcrumbs, warnings, and errors. Without logging, function failures are invisible – you cannot debug what you cannot see.
Logging is part of the core Conversation object. It lives on conv.log, not conv.utils.

Methods

Description: Add a routine breadcrumb.Example:
Description: Flag a soft failure or approaching limit.Example:
Description: Record a handled failure with context.Example:

PII

Set is_pii=True when the message or fields contain personally identifiable information.
Users without PII permission won’t see PII logs in Review or API responses.

Where it appears

  • Conversation Review → Diagnosis: grouped under the turn’s function event.
  • Conversations API: returned on function events as logs.conversation_logger.

Entry shape

Each call produces a JSON object like this:

Patterns

Validation
Retries
Companion redaction

Best practices

  • Keep messages short; put details in fields.
  • Log at decision points, not in tight loops.
  • Prefer identifiers over payload dumps.
  • Default to is_pii=True if you’re unsure.

See also

Last modified on April 16, 2026