Documentation
Interactive Live Streaming Premium
Agora.io Community
How can I set the logs?
Type: Integration issues    Platform: Web   Last Updated: 2021/03/22 01:36:01

Enable or disable log upload

You can call enableLogUpload to upload the logs of the Agora Web SDK to the Agora servers, and call disaleLogUpload to stop the upload.

To ensure that the output log is complete, we recommend calling enableLogUpload to upload logs before creating the Client object.

If you fail to join the channel, the logs are unavailable on the Agora servers.

Set the log output level

Call setLogLevel to set the log output level. Select a level, and you can see the logs in the preceding levels.

  • DEBUG: Outputs all logs.
  • INFO: Outputs logs in the INFO, WARNING and ERROR levels.
  • WARNING: Outputs logs in the WARNING and ERROR levels.
  • ERROR: Outputs logs in the ERROR level.
  • NONE: Outputs no log.

Sample code

See the sample code based on your SDK version.

Web SDK 3.x

// Javascript
// Enable log upload
AgoraRTC.Logger.enableLogUpload();
// Set the log output level as INFO
AgoraRTC.Logger.setLogLevel(AgoraRTC.Logger.INFO);

Web SDK 4.x

// Javascript
// Enable log upload
AgoraRTC.enableLogUpload();
// Set the log output level as INFO
AgoraRTC.setLogLevel(1);

API reference

Web SDK 3.x

Web SDK 4.x