Aagman
Aagman

Reputation: 704

How to get WebRTC logs on Safari Browser

I have been trying to get the webrtc logs for my web application running over safari browser, similar to what we get in firefox by going to the page about:webrtc and on chrome by using chrome://webrtc-internals.

Alternatively, Is there any js API for webrtc to get the logs on the console itself, similar to what we use in Native Android and iOS applications using the RTCLogger.

Thanks in Advance

Upvotes: 23

Views: 7284

Answers (3)

Winlin
Winlin

Reputation: 1424

First, enable Safari > Settings > Advanced > Show Develop menu in menu bar as bellow:

Then, click Safari > Develop > Show JavaScript Console as bellow:

Next, click the Setting icon, select the Console tab, set the WebRTC Logging to Basic, as bellow:

Back to the JavaScript Console, there are WebRTC logs, as bellow:

Test on Safari 16.6

Upvotes: 3

MGY
MGY

Reputation: 8483

Solution

If you open the Safari and also open the console application, you can filter WebRTC logs with these filters:

  • category:WebRTC
  • process:safari (optional)

just copy-paste them one by one to the search bar in the console application. Actually, the second one is optional (process:safari).

I'm not sure about the others but at least you can see:

  • SDP offers and answers
  • ICE candidates
  • WebRTC statistics
  • incoming and outgoing video frame counters

Fun Fact

Based on the official documentation of WebRTC you can't see logs on Safari :)

Useful Infos

  • Do you know there is a WebRTC menu in the Safari. Check the Develop > WebRTC sub-menu
  • Check the Safari Technology Preview app for more options and flags
  • If you’re not logged in as an administrator, you need to enter an administrator name and password to search for and view log messages.

Upvotes: 2

giavac
giavac

Reputation: 1008

On Safari Version 15.4 (17613.1.17.1.13), useful information can be retrieved this way:

  • In Preferences... -> Advanced, ensure Show Develop menu in menu bar is enabled.
  • In the Develop menu Settings, select the Console tab, then ensure WebRTC Logging is not Off (and so choose either Basic or Verbose).

At that point the Console will show WebRTC events and data structures.

e.g.:

enter image description here

Upvotes: 3

Related Questions