← Chrome 156 reference

v156 · web api · webrtc

WebRTC Diagnostic Logging API

Limited availability

  • Chrome · 156, desktop only
  • Edge · not separately reported
  • Firefox · no signal
  • Safari · no signal

Not a Baseline feature: webstatus.dev has no web-features entry (query returned 0 results, 2026-10-25), and BCD’s api/RTCPeerConnection.json has no key for the three static methods (0 matches for “diagnostic”, verified 2026-10-25). The ChromeStatus record ships desktop 156 with no Android/WebView milestone; Firefox and Safari positions are requested but unanswered (“No signal”) at mozilla/standards-positions#1436 and WebKit/standards-positions#699.

Three static methods on RTCPeerConnection — startDiagnosticLogging(), stopDiagnosticLogging(), and cancelDiagnosticLogging() — that let a web application start, stop, or cancel the browser’s collection of its own internal WebRTC diagnostic logs. The logs are never exposed to the page: they are stored where the user controls, require explicit user authorization to collect, and the application is never told whether logging actually happened. The page receives only a session UUID it can quote in bug reports.

New API — desktop-only, single engine, recently out of origin trial

The API graduated from a Chrome origin trial (the runtime feature record for RTCDiagnosticLogging still carries origin_trial_feature_name: "RTCDiagnosticLogging"; the earlier blink-dev intent thread covers that stage) and is enabled by default on desktop Chrome 156 only — the flag record sets "Android": "" and the ChromeStatus record lists no Android/WebView milestone. No other engine ships it and both vendor positions are unanswered, so the surface may still move. In earlier Chrome versions you can test it with --enable-blink-features=RTCDiagnosticLogging or chrome://flags/#enable-experimental-web-platform-features. Remember the API gives the page no success signal: without user/enterprise authorization (e.g. WebRtcDiagnosticLogCollectionAllowedForOrigins) the calls succeed but nothing is collected.

at a glance

What it is“A programmatic interface for web applications to start, stop, and cancel the collection of internal diagnostic logs for WebRTC-related operations performed by the user agent” (webrtc-extensions § Diagnostic logging, quoted 2026-10-25)
WhyLocal developers debug their app; users hand logs to app developers; organizations collect logs across an internal WebRTC deployment; users may share logs with the browser vendor to fix user-agent bugs — the session UUID identifies the session in a bug report (spec use-case list; explainer)
Milestone listingChrome 156 — listed under “Enabled by default” in the milestone=156 listing (fetched 2026-10-25; the listing is authoritative for filing)
Runtime featureRTCDiagnosticLogging — status: {"Android": "", "default": "stable"} in runtime_enabled_features.json5 (read at trunk 2026-10-25): stable on desktop, not enabled on Android; it also carried the origin-trial name RTCDiagnosticLogging
Enterprise policyWebRtcDiagnosticLogCollectionAllowedForOrigins — the ChromeStatus summary names this as how admins authorize collection per origin
Intentsblink-dev Intent (origin-trial stage) · blink-dev Intent to Ship; tracking bug 481412281
ChromeStatus5091582546149376 — WebRTC Diagnostic Logging API
Source: webrtc-extensions; ChromeStatus API record; runtime flag record

syntax

Spec IDL, quoted verbatim from webrtc-extensions § Extensions to the RTCPeerConnection Interface (fetched 2026-10-25):

[Exposed=Window]
partial interface RTCPeerConnection {
  static DOMString startDiagnosticLogging(optional RTCDiagnosticLoggingOptions options = {});
  static undefined stopDiagnosticLogging();
  static undefined cancelDiagnosticLogging();
};

dictionary RTCDiagnosticLoggingOptions {
  record<DOMString, DOMString> metadata;
};

All three methods are static — they are called on the RTCPeerConnection interface object itself (RTCPeerConnection.startDiagnosticLogging()), not on an instance, and the logging session spans all WebRTC activity in the user agent, not one connection. The session state lives in a per-global internal slot, [[RTCDiagnosticLoggingSessionId]], initialized to null (spec § Internal slots).

Source: webrtc-extensions IDL; § Internal slots

reference

RTCPeerConnection.startDiagnosticLogging(options)

Parameters: an optional RTCDiagnosticLoggingOptions dictionary (default {}) whose single member is metadata. Returns: a DOMString — a freshly generated UUID identifying the logging session (the spec says implementations SHOULD use the RFC 4122 § 4.4 random form “to avoid fingerprinting”). Throws:

On success the user agent sets the internal slot to the new UUID and, in parallel, starts logging internal WebRTC activity with metadata as context. Whether logging actually happens is subject to user authorization the page can never observe — “the application never knows if diagnostic logging operations succeed or fail” (spec intro).

RTCPeerConnection.stopDiagnosticLogging()

Parameters: none. Returns: undefined. Throws: InvalidStateError DOMException if no session is running. Clears the session slot and, in parallel, stops the logging session; “the user agent MUST NOT log any WebRTC-related activity once the logging session has stopped”. Logged data from the ended session is kept (in the user-controlled store) — contrast cancelDiagnosticLogging().

RTCPeerConnection.cancelDiagnosticLogging()

Parameters: none. Returns: undefined. Throws: InvalidStateError DOMException if no session is running. Clears the session slot, cancels the session in parallel, and — the difference from stop — “the user agent MUST have removed any logged data associated with the canceled logging session” (spec § Methods, quoted 2026-10-25).

RTCDiagnosticLoggingOptions dictionary

One member, metadata, “of type record<DOMString, DOMString>, defaulting to []: a record containing key-value pairs that the application can use to provide context that can be stored in the diagnostic logs” (spec § Dictionary RTCDiagnosticLoggingOptions members, quoted 2026-10-25). Hard limits enforced by startDiagnosticLogging(): at most 5 entries, each key and value at most 100 characters — beyond either, TypeError. The metadata goes into the logs (e.g. an app version or a support-ticket id); it is never read back by the page.

session lifecycle and state transitions

State of [[RTCDiagnosticLoggingSessionId]]start…()stop…()cancel…()
null (no session)sets slot to new UUID, returns it; logging may begin (subject to authorization)throws InvalidStateErrorthrows InvalidStateError
UUID (session running)throws InvalidStateError — one session at a time per globalslot → null; logging stops; data keptslot → null; logging stops; data deleted
Source: all method steps and the dictionary definition from webrtc-extensions § Methods and § Dictionary members (fetched 2026-10-25)

context and exposure

[Exposed=Window] only — the methods are not available in workers (spec IDL). In Chrome 156 the feature is enabled by default on desktop only: the runtime feature record sets "Android": "" (not enabled) against "default": "stable", and the ChromeStatus record lists no Android/WebView milestone. Collection requires explicit, implementation-defined user authorization (“dedicated UI, configuration files, enterprise policies, prompts, or a combination”), which “may be limited to specific origins”; in Chrome the named mechanism is the WebRtcDiagnosticLogCollectionAllowedForOrigins enterprise policy. The authorization status is never exposed to the application.

Source: webrtc-extensions § Security and Privacy (diagnostic logging); flag record; ChromeStatus

examples

A support-flow sketch: start logging when the user opts into “report a call-quality problem”, attach context the vendor will see inside the logs, and quote the returned UUID in the ticket. Derived from the spec’s method contracts above (labelled gendn-derived; the API itself gives the page no feedback to display):

let sessionId = null;

function beginCallDiagnostics(ticketId) {
  try {
    sessionId = RTCPeerConnection.startDiagnosticLogging({
      metadata: {            // max 5 entries; keys/values ≤ 100 chars
        app: "example-conf 4.2.1",
        ticket: ticketId,
      },
    });
    // Quote sessionId in the bug report — it identifies the log session
    // to whoever the USER chooses to share the logs with.
  } catch (e) {
    // InvalidStateError: a session is already running.
    // TypeError: metadata too large. Nothing else is observable.
  }
}

function endCallDiagnostics(keepLogs) {
  if (sessionId === null) return;
  if (keepLogs) RTCPeerConnection.stopDiagnosticLogging();
  else RTCPeerConnection.cancelDiagnosticLogging();   // deletes the data
  sessionId = null;
}

Feature-detect before offering the UI — the methods are static, so the check needs no connection:

const supported = "startDiagnosticLogging" in RTCPeerConnection;

No Chrome Platform Showcase demo is built for this feature yet (route /v156/webrtc-diagnostic-logging-api/ HEAD-checked 404, 2026-10-25; a demo would appear under the showcase’s Chrome 156 index). A demo could in any case show only the UUID — the logs themselves are invisible to pages by design.

Source: method contracts per webrtc-extensions § Methods; examples gendn-derived from those contracts (labelled accordingly)

browser compatibility

Interim table. BCD has no key for any of the three methods (0 matches for “diagnostic” in api/RTCPeerConnection.json, verified 2026-10-25) and webstatus.dev has no web-features entry. Rows compiled from the linked primary sources.

BrowserSupportEvidence
Chrome156, desktop only; no Android/WebView milestoneChromeStatus record (desktop 156, android null); flag record ("Android": "", "default": "stable"); Intent to Ship
EdgeNot separately reportedNo BCD entry to mirror; Chromium-based Edge typically tracks Chromium, but no Edge-specific source exists for this API (2026-10-25)
FirefoxNo signalmozilla/standards-positions#1436 (position requested, unanswered as recorded by the ChromeStatus record, 2026-10-25)
SafariNo signalWebKit/standards-positions#699 (same basis)
Source: as linked per row; ChromeStatus API record, fetched 2026-10-25

security and privacy

Source: webrtc-extensions § Diagnostic logging — Security and Privacy; § Methods (UUID step)

specifications

DocumentStatus
WebRTC Extensions — § Diagnostic loggingW3C Editor’s Draft of the webrtc-extensions document (the ChromeStatus record links this section as the spec, maturity “Working draft”)
WICG webrtc-diagnostic-logging explainerExplainer; the ChromeStatus record’s linked proposal document

see also