v150 · origin trial · webrtc · diagnostics
WebRTC Diagnostic Logging API
The WebRTC Diagnostic Logging API lets an authorized application ask the browser to record internal WebRTC diagnostic logs for local debugging of hard-to-reproduce connectivity and media-quality issues. The app never sees the log contents — it only receives a session ID. With explicit user authorization, the collected log can also be shared with the browser vendor to help fix user-agent bugs; that share path is user-authorised and implementation-defined, and the API itself no longer carries an upload switch.
In Chrome 150 this API is available through an origin trial on desktop (trial window: Chrome 151–156; ship estimate 156, status “Proposed”, per the chromestatus API as accurate on 2026-08-24). To use it:
- Register your origin for the WebRTC Diagnostic Logging API trial at developer.chrome.com/origintrials and serve the resulting token (
<meta http-equiv="origin-trial">tag orOrigin-Trialheader). The trial's registration id on ChromeStatus is352969620795162625. - Serve the page over HTTPS — an origin trial requires a secure origin. (The current IDL does not itself carry a
SecureContextmarker on theRTCPeerConnectionextension; the requirement here comes from the trial, not from the interface.) - Collection and upload both require explicit user authorization; the authorization UI is implementation-defined (UI controls, prompts, and/or enterprise policies).
Implementation/debug note: the surface on this page is enabled by the runtime feature RTCDiagnosticLogging, which now has status: {"Android": "", "default": "stable"} in runtime_enabled_features.json5 — stable on desktop, disabled on Android — and it carries origin_trial_feature_name: RTCDiagnosticLogging. The pre-rewrite surface (navigator.rtc with promises) is what the separate RTCLegacyDiagnosticLogging feature gates, and that one is still status: experimental. So --enable-blink-features=RTCDiagnosticLogging now forces the new surface, and RTCLegacyDiagnosticLogging is the flag for the old one.
at a glance
| Milestone listing | Chrome 150 — Origin trial (trial window 151–156, desktop) |
|---|---|
| Ship estimate | Feature detail (chromestatus API, accurate as of 2026-08-24): desktop 156, status text “Proposed”, active stage “Prepare to ship” |
| Interface | static methods on RTCPeerConnection (startDiagnosticLogging, stopDiagnosticLogging, cancelDiagnosticLogging) |
| Context | Collection + upload require explicit user authorization; an origin trial requires a secure origin |
| Runtime flag | RTCDiagnosticLogging in runtime_enabled_features.json5 (status {Android: "", default: "stable"}, origin-trial feature); the pre-rewrite surface is gated by RTCLegacyDiagnosticLogging (status experimental) |
| Standards body | W3C WebRTC Extensions — Diagnostic Logging (Working draft; incubated in WICG) |
| ChromeStatus | 5091582546149376 — WebRTC Diagnostic Logging API |
Syntax
The API is exposed as a set of static methods on the RTCPeerConnection interface — synchronous calls, not the promise-returning navigator.rtc surface of the earlier draft. IDL from the WebRTC Extensions specification:
[Exposed=Window]
partial interface RTCPeerConnection {
static DOMString startDiagnosticLogging(optional RTCDiagnosticLoggingOptions options = {});
static undefined stopDiagnosticLogging();
static undefined cancelDiagnosticLogging();
};
dictionary RTCDiagnosticLoggingOptions {
record<DOMString, DOMString> metadata;
};
Source: W3C WebRTC Extensions — Diagnostic Logging (IDL); WICG WebRTC Diagnostic Logging (the incubation document, serving the same surface)
startDiagnosticLogging(options)
Begins a logging session. The user agent starts recording internal WebRTC logs, and the call returns a unique session ID (a UUID) — the only piece of diagnostic information the application ever receives. There is no promise: the returned string is the session ID. The session lives in an [[RTCDiagnosticLoggingSessionId]] internal slot on the relevant global object, which the specification initializes to null. (The W3C WebRTC Extensions specification is internally inconsistent about where this slot lives: its Internal slots section defines it on the relevant global object, while its algorithm steps reference RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]; this page follows the Internal slots definition.)
| Part | Detail |
|---|---|
| Parameters | options (optional) — metadata (record of string key–value pairs): custom metadata attached to the log. This is the dictionary's only member; the earlier draft's allowUpload switch has been removed from the API. |
| Metadata limits | At most 5 key–value pairs; each key and each value at most 100 characters |
| Returns | DOMString — the unique session ID (the specification says it is a randomly generated UUID, and SHOULD be in RFC 4122 §4.4 form) |
| Exceptions | InvalidStateError — the relevant global object already has a non-null [[RTCDiagnosticLoggingSessionId]] internal slot, i.e. a session is already running. TypeError — the metadata exceeds 5 entries, or any key or value exceeds 100 characters. (The WICG incubation document's step for the metadata case still reads “return a promise rejected with a TypeError” even though this operation is now synchronous; the W3C specification already reads “throw a TypeError”.) |
stopDiagnosticLogging()
Ends the session and finalizes the log file. The user agent must not log WebRTC activity for the session afterwards. The call returns undefined; whether the finalized log is ever shared with the browser vendor is a matter of user authorization and user-agent behaviour, not of an API switch.
| Part | Detail |
|---|---|
| Returns | undefined |
| Exceptions | InvalidStateError — the [[RTCDiagnosticLoggingSessionId]] internal slot is null, i.e. no session is running |
cancelDiagnosticLogging()
Stops the session and discards everything collected; the user agent must not log afterwards, and because the data is discarded it cannot be shared. The call returns undefined. Two naming mismatches are worth knowing about, and neither changes what you call: the WICG incubation document's section heading for this operation reads discardDiagnosticLogging() while its IDL — the authoritative surface, and what implementers type — declares cancelDiagnosticLogging() (the W3C specification has no discardDiagnosticLogging anywhere); and the explainer's example code uses cancelLogging(). The explainer also still names the second operation finishDiagnosticLogging() where the IDL says stopDiagnosticLogging().
| Part | Detail |
|---|---|
| Returns | undefined |
| Exceptions | InvalidStateError — the [[RTCDiagnosticLoggingSessionId]] internal slot is null, i.e. no session is running |
What the app can and cannot see
The design deliberately keeps diagnostic content away from the application. The explainer states as an explicit non-goal that the API exposes nothing to the app beyond the session ID — the logs may contain internal information about user activity. The finished log is stored as a local file that the user can access, and any share path gives it to the user agent (the browser vendor) — never to the site. The format of the log and the mechanism by which it may be shared are intentionally unspecified; the only hard requirement is explicit user authorization. A site can attach small pieces of metadata (for example an app identifier) so a shared log can be matched to a bug report filed with the browser vendor.
Source: WICG explainer — goals, non-goals, privacy & securityExamples
// Before starting a call — begin a session (metadata only: <= 5 pairs, <= 100 chars each)
const sessionId = RTCPeerConnection.startDiagnosticLogging({
metadata: { app: "my-call-app" },
}); // synchronous: DOMString, not a promise
// The app stores the session ID — it is the ONLY data it ever gets back.
// When the call ends normally — finalize the log locally
RTCPeerConnection.stopDiagnosticLogging();
// When the captured session is not useful — discard it entirely
RTCPeerConnection.cancelDiagnosticLogging();
Source: WICG explainer — proposed approach; W3C WebRTC Extensions — Diagnostic Logging
Browser compatibility
There is no browser-compat-data (BCD) entry for this API yet, so the table below is an interim view built from ChromeStatus ship data and public signals — not from BCD.
| Browser | Status | Notes |
|---|---|---|
| Chrome | 151–156 (origin trial) | Desktop origin trial; feature detail (API, accurate as of 2026-08-24) estimates desktop shipping 156, status “Proposed” |
| Edge | Not separately reported | No Edge position is recorded on ChromeStatus; no public support evidence (Chromium engine equivalence is not a support commitment) |
| Firefox | No signal | Recorded on ChromeStatus |
| Safari | No signal | Recorded on ChromeStatus |
Beyond vendor signals, the explainer records stakeholder positions: Google (implementer) positive, and ByteDance positive (as a WebRTC application stakeholder, not a browser vendor).
Source: chromestatus.com/feature/5091582546149376; WICG explainer — stakeholder feedback; mdn/browser-compat-data (no entry as of October 2026)Specifications
| Specification | Status |
|---|---|
| WebRTC Extensions — Diagnostic Logging | Working draft (W3C WebRTC Working Group) — the canonical home recorded on ChromeStatus |
| WebRTC Diagnostic Logging API | WICG draft (incubation) — serves the same surface as the WebRTC Extensions section |
| W3C WebRTC Extensions — proposal issue #124 | Public discussion |
See also
- WICG — WebRTC Diagnostic Logging explainer
- W3C WebRTC Extensions — Diagnostic Logging
- W3C webrtc-extensions proposal — diagnostic logging
- Chrome origin trials — registration
- Chrome Platform Showcase — WebRTC Diagnostic Logging API (still on the pre-rewrite surface as of 2026-10-06; also: capability & policy probe, bug-report companion)