# SDK logs (/en/realtime-media/im/reference/sdk-logs)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<_PlatformTabsGroup groupMode="structured" canonicalPlatform="web" platforms="[&#x22;android&#x22;,&#x22;ios&#x22;,&#x22;web&#x22;,&#x22;react-native&#x22;,&#x22;windows&#x22;,&#x22;unity&#x22;,&#x22;flutter&#x22;]" showTabs="true">
  <_PlatformPanel platform="android">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="android" />

    If you’re troubleshooting an issue with the Agora Chat SDK, Agora support team might ask you to send the SDK logs. Logs record information about events that occurred in the SDK. These include errors and warnings as well as informational events.

    By default, the SDK generates three log files, `easemob.log` and two `easemob_Y-m-d_H-M-S.log` files, each with a maximum size of 2048 KB (2 MB). These log files are encoded in UTF-8. The SDK writes the latest logs in `easemob.log`. When `easemob.log` is full, the SDK renames it to the name of the current time-dependent log file. If there are more than three log files, the SDK deletes the earliest log file, and creates a new `easemob.log` to record the latest logs.

    For example, the SDK generates `easemob.log` to record logs at 8:00:00 a.m. on January 1, 2024. If this file is completely written at 8:30:00 a.m., the SDK renames it `easemob_2024-01-01_08-30-00.log`. At 9:30:00 a.m. and 10:30:30 a.m., the SDK generates `easemob_2024-01-01_09-30-30.log` and `easemob_2024-01-01_10-30-30.log`. At this time, `easemob_2024-01-01_08-30-00.log` will be removed before the SDK generates `easemob.log` to record the latest logs.

    ## Collect SDK logs [#collect-sdk-logs]

    To access SDK logs, take the following steps:

    1. Enable the debug mode.

       In this mode, the SDK outputs all types of logs, including debugging information, warnings, and errors.

       ```java
       ChatClient.getInstance().setDebugMode(true);
       ```

       If you only require error logs, disable the debug mode.

       ```java
       ChatClient.getInstance().setDebugMode(false);
       ```

    2. Get local logs.

       Open the logs directory `/sdcard/Android/data/{package name}/{appkey}/core_log/` which contains the SDK logs.

       ```bash
       adb pull /sdcard/android/data/{package name}/{appkey}/core_log
       ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="ios">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="ios" />

    If you’re troubleshooting an issue with the Agora Chat SDK, Agora support team might ask you to send the SDK logs. Logs record information about events that occurred in the SDK. These include errors and warnings as well as informational events.

    By default, the SDK generates three log files, `easemob.log` and two `easemob_Y-m-d_H-M-S.log` files, each with a maximum size of 2048 KB (2 MB). These log files are encoded in UTF-8. The SDK writes the latest logs in `easemob.log`. When `easemob.log` is full, the SDK renames it to the name of the current time-dependent log file. If there are more than three log files, the SDK deletes the earliest log file, and creates a new `easemob.log` to record the latest logs.

    For example, the SDK generates `easemob.log` to record logs at 8:00:00 a.m. on January 1, 2024. If this file is completely written at 8:30:00 a.m., the SDK renames it `easemob_2024-01-01_08-30-00.log`. At 9:30:00 a.m. and 10:30:30 a.m., the SDK generates `easemob_2024-01-01_09-30-30.log` and `easemob_2024-01-01_10-30-30.log`. At this time, `easemob_2024-01-01_08-30-00.log` will be removed before the SDK generates `easemob.log` to record the latest logs.

    `AgoraChatOptions#AgoraChatLogLevel` specifies the log level for output.

    * (default) `AgoraChatLogLevelDebug`: All logs;
    * `AgoraChatLogLevelWarning`: Warnings and errors.
    * `AgoraChatLogLevelError`: Errors.

    If you want to output SDK logs on the XCode console, you can enable log output during SDK initialization.

    ```objc
    AgoraChatOptions* option = [AgoraChatOptions optionsWithAppkey:@""];
    // Output logs on the XCode console
    option.enableConsoleLog = YES;
    // Set the log level. The default value is `AgoraChatLogLevelDebug`, indicating all logs are output.
    option.logLevel = AgoraChatLogLevelDebug;
    [ChatClient.sharedClient initializeSDKWithOptions:option];
    ```

    ## Collect SDK logs [#collect-sdk-logs-1]

    Here, a simulator is used as an example.
    To access SDK logs, take the following steps:

    1. Copy the app sandbox path printed by `NSHomeDirectory()`.
    2. In the Finder on your Mac system, select **Go > Go to Folder**.
    3. Press **Ctrl+V** to paste the path and press **Return**.
    4. Open the logs directory `{app sandbox path}/Library/Application Support/HyphenateSDK/easemobLog/` which contains the SDK logs.

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="web">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="web" />

    If you’re troubleshooting an issue with the Agora Chat SDK, Agora support team might ask you to send the SDK logs. Logs record information about events that occurred in the SDK. These include errors and warnings as well as informational events.

    ## Collecting SDK logs [#collecting-sdk-logs]

    * Enable log output:

      ```javascript
      AC.logger.enableAll();
      ```

    * Disable log output:

      ```javascript
      AC.logger.disableAll();
      ```

    * Set the level of logs to be output:

      ```javascript
      // 0 - 5 or 'TRACE'，'DEBUG'，'INFO'，'WARN'，'ERROR'，'SILENT'.
      AC.logger.setLevel(0);
      ```

    * Set whether to cache logs:

      ```javascript
      AC.logger.setConfig({
        useCache: false, // Whether to cache logs.
        maxCache: 3 * 1024 * 1024, // The maximum number of bytes of logs that can be cached.
      });
      // Cache logs of all levels
      AC.logger.setLevel(0);
      ```

    * Download logs:

      ```javascript
      AC.logger.download();
      ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="react-native">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="react-native" />

    If you’re troubleshooting an issue with the Agora Chat SDK, Agora support team might ask you to send the SDK logs. Logs record information about events that occurred in the SDK. These include errors and warnings as well as informational events.

    ## Collect SDK logs [#collect-sdk-logs-2]

    To output logs on the console, you need to enable the debug mode by setting `debugModel` to `true` during SDK initialization.

    ```typescript
    chatlog.log(`${ChatClient.TAG}: login: `, userName, "******", isPassword);
    ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="windows">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="windows" />

    If you’re troubleshooting an issue with the Agora Chat SDK, Agora support team might ask you to send the SDK logs. Logs record information about events that occurred in the SDK. These include errors and warnings as well as informational events.

    By default, the SDK generates three log files, `easemob.log` and two `easemob_YYYY-MM-DD_HH-MM-SS.log` files, each with a maximum size of 2048 KB (2 MB). These log files are encoded in UTF-8. The SDK writes the latest logs in `easemob.log`. When `easemob.log` is full, the SDK renames it to the name of the current time-dependent log file. If there are more than three log files, the SDK deletes the earliest log file, and creates a new `easemob.log` to record the latest logs.

    For example, the SDK generates `easemob.log` to record logs at 8:00:00 a.m. on January 1, 2024. If this file is completely written at 8:30:00 a.m., the SDK renames it `easemob_2024-01-01_08-30-00.log`. At 9:30:00 a.m. and 10:30:30 a.m., the SDK generates `easemob_2024-01-01_09-30-30.log` and `easemob_2024-01-01_10-30-30.log`. At this time, `easemob_2024-01-01_08-30-00.log` will be removed before the SDK generates `easemob.log` to record the latest logs.

    In debugging mode, the SDK outputs all types of logs, including debugging information, warnings, and errors. By default, the SDK only outputs error logs. Therefore, to output all logs, enable the debugging mode.

    ```csharp
    Options options = new Options("YourAppKey");
    options.DebugMode = true;
    SDKClient.Instance.InitWithOptions(options);
    ```

    ## Collect SDK logs [#collect-sdk-logs-3]

    Windows SDK logs reside in the `sdkdata\easemobLog` directory which is at the same level as the directory of the executable program.

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="unity">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="unity" />

    If you’re troubleshooting an issue with the Agora Chat SDK, Agora support team might ask you to send the SDK logs. Logs record information about events that occurred in the SDK. These include errors and warnings as well as informational events.

    By default, the SDK generates three log files, `easemob.log` and two `easemob_Y-m-d_H-M-S.log` files, each with a maximum size of 2048 KB (2 MB). These log files are encoded in UTF-8. The SDK writes the latest logs in `easemob.log`. When `easemob.log` is full, the SDK renames it to the name of the current time-dependent log file. If there are more than three log files, the SDK deletes the earliest log file, and creates a new `easemob.log` to record the latest logs.

    For example, the SDK generates `easemob.log` to record logs at 8:00:00 a.m. on January 1, 2024. If this file is completely written at 8:30:00 a.m., the SDK renames it `easemob_2024-01-01_08-30-00.log`. At 9:30:00 a.m. and 10:30:30 a.m., the SDK generates `easemob_2024-01-01_09-30-30.log` and `easemob_2024-01-01_10-30-30.log`. At this time, `easemob_2024-01-01_08-30-00.log` will be removed before the SDK generates `easemob.log` to record the latest logs.

    In debugging mode, the SDK outputs all types of logs, including debugging information, warnings, and errors. By default, the SDK only outputs error logs. Therefore, to output all logs, enable the debugging mode.

    ```csharp
    Options options = new Options(appkey);
    options.AutoLogin = false;
    options.UsingHttpsOnly = true;
    options.DebugMode = true;
    SDKClient.Instance.InitWithOptions(options);
    ```

    ## Collect SDK logs [#collect-sdk-logs-4]

    * Unity Mac

      The log path is `/Users/XXX/Library/Application Support/YYY/ZZZ/sdkdata/easemobLog` or `/Users/XXX/Library/Application Support/com.YYY.ZZZ/sdkdata/easemobLog`.

      1. `XXX` indicates the Mac username.
      2. `YYY` indicates the company name, which is `DefaultCompany` by default.
      3. `ZZZ` indicates the app name.

    * Unity Windows

      The log path is `C:\Users\XXX\AppData\LocalLow\YYY\ZZZ\sdkdata\easemobLog`.

      1. `XXX` indicates the Windows username.
      2. `YYY` indicates the company name set in Unity, which is `DefaultCompany` by default.
      3. `ZZZ` indicates the app name.

    * Unity iOS

      The local logs are obtained in the same way as the iOS platform.

      Here, a simulator is used as an example.

      To access SDK logs, take the following steps:

      1. Copy the app sandbox path printed by `NSHomeDirectory()`.
      2. In the Finder on your Mac system, select **Go > Go to Folder**.
      3. Press **Ctrl+V** to paste the path and press **Return**.
      4. Open the logs directory `{app sandbox path}/Library/Application Support/HyphenateSDK/easemobLog/` which contains the SDK logs.

    * Unity Android

      In Android Studio, you can choose **View** > **Tool Windows** > **Device File Explorer** and check the log folder on your device by accessing `/data/data//sdkdata/easemobLog`.

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="flutter">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="flutter" />

    This platform does not support logs.

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>
</_PlatformTabsGroup>
