/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

Logger

Copy link

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 app. You can closely monitor the operation of the Sendbird SDK and improve debug efficiency using our logging system.


Log levels

Copy link

Log levels can be used to categorize and control log outputs. The Chat SDK for JavaScript has six different log levels with predefined log functions and they can be filtered by your browser's Developer Tools.

List of log levels

Copy link
LevelDescription

NONE

No logs recorded.

VERBOSE

console.log
Logs all detailed information of the events and activities, as well as the log messages in DEBUG, INFO, WARN, and ERROR.

DEBUG

console.log
Logs what's happening inside the SDK that could be helpful to debug unexpected behaviors, as well as the log messages in DEBUG, INFO, WARN, and ERROR.

INFO

console.log
Logs the general events that take place in the Sendbird SDK, as well as the log messages in WARN and ERROR.

WARN

console.warn
Logs unexpected events which wouldn't affect the operation of Sendbird SDK but might cause problems. This log level also shows the log messages in ERROR.

ERROR

console.error
Logs what has caused failures in the specific events, but not a Sendbird SDK-wide failure.


How to configure the log level

Copy link

The default log level set is LogLevel.WARN, which means that the Sendbird SDK keeps logs of both errors and accompanying warning messages. You can change the settings through the logLevel property in the SendbirdChat class as follows.

sb.logLevel = LogLevel.VERBOSE;

List of parameters

Copy link
Parameter nameTypeDescription

logLevel

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. You can also use NONE in order to not record any logs regarding Sendbird Chat SDK on the client app.