Media/WebRTC/Logging: Difference between revisions

From MozillaWiki
< Media‎ | WebRTC
Jump to navigation Jump to search
(Created page with "The various pieces of WebRTC do a lot of logging, and these logs can be very helpful to developers when trying to track down problems. This page provides instructions for turn...")
 
Line 14: Line 14:
* NSPR_LOG_FILE=/path/to/nspr.log (if you don't want the default stderr)
* NSPR_LOG_FILE=/path/to/nspr.log (if you don't want the default stderr)


You can also add ",timestamp:1" to that list if you want each log message to include timestamps.
You can also add ",timestamp" to that list if you want each log message to include timestamps.


=== Media (the GIPS stack: RTP/RTCP) ===
=== Media (the GIPS stack: RTP/RTCP) ===

Revision as of 20:03, 10 November 2014

The various pieces of WebRTC do a lot of logging, and these logs can be very helpful to developers when trying to track down problems. This page provides instructions for turning these logging messages on so you can include them in bug reports, etc..

ICE/STUN/TURN

Set the following environment variables:

  • R_LOG_DESTINATION=stderr
  • R_LOG_LEVEL=3 (can be anything between 1 and 9)
  • R_LOG_VERBOSE=1 (if you want to include the module name generating the message)

Signaling (SDP offer/answer handling)

This uses the normal Mozilla logging infrastructure, which uses a comma-separated list of modules, each one with its indicated log level. For WebRTC, you'll be most interested in

  • NSPR_LOG_MODULES=signaling:5,mtransport:5
  • NSPR_LOG_FILE=/path/to/nspr.log (if you don't want the default stderr)

You can also add ",timestamp" to that list if you want each log message to include timestamps.

Media (the GIPS stack: RTP/RTCP)

This also uses the Mozilla logging infrastructure, but it uses a bitmask to select which items are logged, instead of the default log levels. It also logs to a different destination by default.

  • NSPR_LOG_MODULES=webrtc_trace:65535
  • WEBRTC_TRACE_FILE=/path/to/WebRTC.log (the default is just "WebRTC.log")

The full list of logging options is found in the TraceLevel enum (see <http://mxr.mozilla.org/mozilla-central/source/media/webrtc/trunk/webrtc/common_types.h#83>).