Skip to content

[v1.2] C SDK ./logs/ directory — auto-create or make file logging opt-in #121

@MaxMansfield

Description

@MaxMansfield

Context

The underlying C++ RTMS SDK writes its internal log files to ./logs/<exe>_<pid>_<YYYYMMDD>_<seq>.logrelative to the process's current working directory. If the directory doesn't exist relative to CWD, every SDK log call produces this on stderr:

failed to open file [./logs/<exe>_<pid>_<date>_<seq>.log] errno = 2

In containerized deployments (Docker, Fargate, ECS, K8s), CWD is typically /app/ (set by WORKDIR /app), so the SDK looks for /app/logs/ which doesn't exist by default. Result: the log stream is flooded with hundreds of errno=2 lines per second, drowning the actual application logs. The SDK keeps working (silently fails the file open) but the noise makes debugging unreadable.

Discovered during AWS Terraform deploy on 2026-05-20.

What to ship

Pick one or combine:

  1. Auto-create the directory at SDK init. Fall back silently to stdout-only if create fails. Removes the surprise entirely with zero config change for callers.
  2. Make file logging opt-in — add ZM_RTMS_LOG_FILE=/path env var; when unset, log to stdout/stderr only. Most cloud deploys never want disk logs anyway.
  3. Make the directory configurable via ZM_RTMS_LOG_DIR (default ./logs/). Lets callers point at /tmp/rtms or /var/log/rtms.

Recommendation: ship #1 (auto-create) + #2 (opt-in file logging) so cloud deployments work out of the box AND customers can keep file logs if they want.

Acceptance criteria

  • SDK no longer spams failed to open file ... errno = 2 when CWD has no ./logs/ directory
  • If file logging is enabled and directory missing, attempt to create it; if create fails, fall back to stdout-only with a single startup WARN
  • Add ZM_RTMS_LOG_DIR env var to override the default path
  • Optional: ZM_RTMS_LOG_FILE_ENABLED=false to disable file logging entirely
  • Documented in README and the cloud-deploy guidance section

Cross-language parity

  • Behavior is in the C SDK so it affects both bindings automatically
  • Verify Node.js deployment shows the same file pattern (./logs/node_<pid>_<date>_<seq>.log)
  • Same env vars work for both languages

Source

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

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 SDKcloud deployAffects Docker / ECS / Fargate / Kubernetes deploymentsv1.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