Chat UIKit React v3
Chat UIKit React
Chat UIKit
React
Version 3

Logger

Copy link

Sendbird UIKit for React 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 UIKit 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 logger in UIKit for React has four different log levels with predefined values and uses three different colors to distinguish each of them.

LevelDescription

info (gray)

Logs general events of UIKit.

warning (orange)

Logs unexpected events which wouldn't affect the operation of UIKit, but might cause problems.

error (red)

Logs what have caused failures in the specific events, but not an UIKit-wide failure.

all (respective to level)

Logs all detailed information of the events and activities, including info, warning, and error. The values of all and debug work the same way.


How to configure the log level

Copy link

By default, log levels for Sendbird UIKit for React are turned off. You can change the settings through the config.logLevel prop in the SendbirdProvider or App components as follows:

// Output all logs.
<SendbirdProvider appId={appId} userId={userId} config={{ logLevel: 'info' }} >
    ...
</SendbirdProvider>

// Output only specific logs.
<SendbirdProvider appId={appId} userId={userId} config={{ logLevel: ['info', 'warning'] }} >
    ...
</SendbirdProvider>

List of parameters

Copy link
Parameter nameTypeDescription

config.logLevel

string or array

Specifies one or more severity levels of log to retrieve. You can select either a single or multiple log level types. Acceptable values are none, error, warning, info, all, and debug.


Log format

Copy link

Log messages as output are displayed on the console in the order as follows:

{tag} | {level} | {date time} | {message}