Skip to content

[v1.2] Route SDK logs through Python logging module (and equivalent in Node) #123

@MaxMansfield

Description

@MaxMansfield

Context

The SDK's log_info, log_warn, log_debug, log_error functions write directly to stdout in their own format. This means:

  • Customers can't route SDK logs through their existing log stack (Datadog, Splunk, Loki, Elastic) without parsing + re-emitting
  • Customers can't change log levels per logger
  • Customers can't attach contextual fields (request_id, meeting_uuid) to SDK logs via Python logging extras
  • When ZM_RTMS_LOG_FORMAT=json is set, the JSON field names (timestamp, level, component, message) don't match conventional Python logging fields (ts, level, name, msg), so log aggregators see them as a separate stream

What to ship

Python: route all SDK logs through Python's logging module on named loggers:

  • rtms (root)
  • rtms.webhook
  • rtms.client
  • rtms.eventloop

The customer's logging.basicConfig / dictConfig controls format, level, handlers. ZM_RTMS_LOG_FORMAT becomes a convenience that configures a default JsonFormatter on the root rtms logger, but customers who want custom routing do so via standard Python logging mechanisms.

Node.js: accept a logger object via SDK constructor (or rtms.setLogger(loggerInstance)). Compatible with winston, pino, or any logger that has .info/warn/error/debug methods. If no logger provided, default to console.

Acceptance criteria

  • Python: SDK uses logging.getLogger("rtms.*") for all log output
  • Existing ZM_RTMS_LOG_FORMAT=json configures a default JsonFormatter on the rtms logger
  • Existing ZM_RTMS_LOG_LEVEL sets the root rtms logger's level
  • Customer can override format / handlers via standard dictConfig
  • Node.js: SDK accepts a custom logger via constructor or setter
  • Documentation showing Datadog / Splunk / Loki / OpenTelemetry routing examples

Cross-language parity

  • Both ship in same release
  • Same env var contracts (ZM_RTMS_LOG_FORMAT, ZM_RTMS_LOG_LEVEL)
  • Equivalent customization stories in examples/python.md and examples/node.md

Source

Tracked in vault: Projects/RTMS SDK v1.2.md → DEVS-X12.

Tracker

Part of the v1.2 milestone. Project: https://github.com/orgs/zoom/projects/11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXQuality-of-life or DX improvement to the SDKlanguage parityRequires parallel implementation in Node.js and Python with parity check in PRv1.2Part of the v1.2 release

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions