/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
Version 4

Logger

Copy link

Sendbird Chat SDK for iOS 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 following table lists the five different log levels available in the logger in Sendbird Chat SDK for iOS.

List of log levels

Copy link
LevelDescription

none

No logs recorded.

error

Logs things that have caused failures in specific events, but not an SDK-wide failure.

warn

Logs unexpected events which doesn't affect the operation of Chat SDK, but might cause problems.

info

Logs general events of the Chat SDK.

verbose

Logs all the details of the events and activities, including log messages in error, warn, and info.


How to configure the log level

Copy link

The default log level set for Sendbird Chat SDK for iOS is none, which means that the Sendbird SDK keeps logs of warning messages. You can change the settings through the setLogLevel(_:) method in the SendbirdChat class as follows.

// Sets the log level when initalizing the SendbirdChat instance.
let initParams = InitParams(applicationId: "")
initParams.logLevel = .verbose
SendbirdChat.initialize(params: initParams) {
    // ...
    
} completionHandler: { error in
    // ...
    
}

// Sets the log level through the `setLogLevel()` method.
SendbirdChat.setLogLevel(.error)

List of parameters

Copy link
Parameter nameTypeDescription

logLevel

LogLevel

Specifies the severity level of the log to retrieve. One takes precedence over the other in the order of .none, .error, .warning, .info, and .verbose.


Log filtering

Copy link

All Sendbird Chat SDK log messages start with SendbirdChat. If you want to see the log messages from Sendbird Chat SDK, search for messages with the keyword SendbirdChat.

The following logs show how to read the Sendbird Chat SDK logs.

#[Sendbird](LOG_LEVEL)-[FILE_NAME:LINE_NUMBER] LOG_MESSAGE
SendbirdChat [2022.06.12 06:08:33.548 +0900] [LocalCache] [INFO] loop count=3, channels size=1, isSyncCompleted=true
SendbirdChat [2022.06.12 06:08:33.549 +0900] [LocalCache] [INFO] getAllChangeLogs(with:completionHandler:)
SendbirdChat [2022.06.12 06:08:33.683 +0900] [LocalCache] [INFO] getAllChangeLogs(with:completionHandler:) Getting channel change logs is completed.
SendbirdChat [2022.06.12 06:08:35.548 +0900] [SendBirdChat] [VERBOSE] updateUnreadCountInfo(unreadCountInfo:) Update unread count ["unread_cnt": {
SendbirdChat [2022.06.12 06:08:35.557 +0900] [INFO] broadcast(task:) (DELEGATE) [ChannelCollectionEventBroadcaster (EventBroadcaster) broadcast service]