Sendbird Chat SDK for JavaScript offers a logging system that allows you to keep track of a number of events and activities including data flow, error, and information while running your application. You can closely monitor the operation of the Sendbird SDK and improve debug efficiency using our logging system.
Log levels can be used to categorize and control log outputs. Sendbird Chat SDK for JavaScript has five different log levels with predefined log functions and they can filtered by your browser's Developer Tools.
Level | Description |
---|---|
VERBOSE |
|
DEBUG |
|
INFO |
|
WARN |
|
ERROR |
|
The default log level set for Sendbird Chat SDK for JavaScript is LogLevel.WARN
, which means that Sendbird SDK will keep logs of both errors and warning messages. You can change the settings through the setLogLevel()
method in the SendBird
class as follows:
SendBird.setLogLevel(SendBird.LogLevel.VERBOSE);
Parameter | Type | Description |
---|---|---|
| LogLevel | Specifies the severity level of log to retrieve. Each one takes precedence over the other in the order of VERBOSE, DEBUG, INFO, WARN, and ERROR. |
The following logs show how Sendbird Chat SDK logs will appear.
POST request
[DEBUG ] url: /group_channels/sendbird_group_channel_32543200_ad2dccf93d213ae2c8fb7e8ff6d68281ca0c91ca
[DEBUG ] data: {user_ids: Array(1), name: "Group Channel_Ballet"}
GET request
[DEBUG ] url: /group_channels/sendbird_group_channel_32543200_ad2dccf93d213ae2c8fb7e8ff6d68281ca0c91ca
[DEBUG ] data: {show_member: true, show_read_receipt: true, show_delivery_receipt: true}
GET request
[DEBUG ] url: /group_channels/sendbird_group_channel_32543200_ad2dccf93d213ae2c8fb7e8ff6d68281ca0c91ca
[DEBUG ] data: {show_member: true, show_read_receipt: true, show_delivery_receipt: true}
POST response
[DEBUG ] data: {invited_at: 1611133946581, custom_type: "", is_ephemeral: false, read_receipt: {…}, member_state: "joined", …}
[WARN ] `setErrorFirstCallback(false)` will be deprecated. Please use `setErrorFirstCallback(true)` and the error first callback: `(error, ...args) => { }`.
GET response
[DEBUG ] data: {invited_at: 1611133946581, custom_type: "", is_ephemeral: false, read_receipt: {…}, member_state: "joined", …}
GET response
[ERROR ] error: SendBirdException: Not authorized. "User must be a member.".
at S.value (http://localhost:8080//SendBird.min.js:6:16818)
at http://localhost:8080//SendBird.min.js:6:17612