> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-docs-limits-personalize.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to share Android MoEngage SDK logs

> Enable and share verbose MoEngage Android SDK logs with the support team to resolve issues faster.

Sometimes, our support team will ask for logs as the first step to resolve the issue faster. Logs can help us and in some cases you quickly identify the issue and share the exact solution to a problem. 

In this document, we list a few steps that you can execute to share the MoEngage SDK logs with the MoEngage support team.

<iframe src="https://www.youtube.com/embed/kQjcdzQkOq4" title="YouTube video player" frameborder="0" className="w-full aspect-video rounded-xl" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen />

## Enable debug logs for Android

Use the snippet below to enable all MoEngage SDK-related logs.

<CodeGroup>
  ```kotlin Kotlin theme={null}
  import com.moengage.core.DataCenter
  import com.moengage.core.MoEngage
  import com.moengage.core.config.LogConfig
  import com.moengage.core.LogLevel
  import com.moengage.core.enableAllLogs

  enableAllLogs()

  val moEngage = MoEngage.Builder(this, "YOUR_WORKSPACE_ID", DataCenter.DATA_CENTER_X)
      .configureLogs(LogConfig(logLevel = LogLevel.VERBOSE, isEnabledForReleaseBuild = true))
      .build()
  MoEngage.initialiseDefaultInstance(moEngage)
  ```

  ```java Java theme={null}
  import com.moengage.core.MoEngage;
  import com.moengage.core.config.LogConfig;
  import com.moengage.core.LogLevel;
  import com.moengage.core.MoESdkStateHelper;

  MoESdkStateHelper.enableAllLogs();

  // replace X with the correct data center
  MoEngage moEngage = new MoEngage.Builder(this, "YOUR_WORKSPACE_ID", DataCenter.getDataCenterX())
      .configureLogs(new LogConfig(LogLevel.VERBOSE, true))
      .build();
  MoEngage.initialiseDefaultInstance(moEngage);
  ```
</CodeGroup>

<Warning>
  `enableAllLogs()` only captures logs generated after it is called — it does not replay earlier logs. To turn off all logs, call `disableAllLogs()`. Set `isEnabledForReleaseBuild` to `false` and remove these calls before pushing the app to production.
</Warning>

## Enable debug logs for React Native

Follow the same steps as the [Android section](#enable-debug-logs-for-android) above. In addition, React Native provides log control at the TypeScript level. Update your MoEngage initialization code in `App.tsx` (or your app entry file) to pass a log configuration:

```typescript TypeScript theme={null}
import { MoEInitConfig, MoEPushConfig, MoEngageLogConfig, MoEngageLogLevel } from "react-native-moengage";
import ReactMoE from "react-native-moengage";

const moEInitConfig = new MoEInitConfig(
  MoEPushConfig.defaultConfig(),
  new MoEngageLogConfig(MoEngageLogLevel.VERBOSE, true)
);

ReactMoE.initialize("YOUR_WORKSPACE_ID", moEInitConfig);
```

<Warning>
  Ensure to remove the above lines before the application is pushed to production.
</Warning>

## Android Studio

We will list the steps for sharing logs in Android Studio here, but similar steps apply to other IDEs.

1. First, connect your device to your laptop/PC.
2. Open Android Studio and click on Logcat.

   <Frame>
     <img src="https://mintcdn.com/moengage-docs-limits-personalize/rtSLSROQ2XLKNDFn/images/image1.png?fit=max&auto=format&n=rtSLSROQ2XLKNDFn&q=85&s=a46fcc262d944583d50c6051271b4656" alt="Image1" width="1605" height="887" data-path="images/image1.png" />
   </Frame>
3. Type MoE in the search field to filter only MoEngage logs(Please make sure the device is showing in device details and the correct device is shown).

   <Frame>
     <img src="https://mintcdn.com/moengage-docs-limits-personalize/rtSLSROQ2XLKNDFn/images/image3-1.png?fit=max&auto=format&n=rtSLSROQ2XLKNDFn&q=85&s=281b560f521f5429a1e11001c3f85b6c" alt="Image3 1" width="1610" height="909" data-path="images/image3-1.png" />
   </Frame>

   <Frame>
     <img src="https://mintcdn.com/moengage-docs-limits-personalize/rtSLSROQ2XLKNDFn/images/image5.png?fit=max&auto=format&n=rtSLSROQ2XLKNDFn&q=85&s=666b49be19eebd448ebfba0119b9bc3e" alt="Image5" width="1920" height="1080" data-path="images/image5.png" />
   </Frame>
4. MoEnage SDK-related logs should look like something shown in the picture below.

   <Frame>
     <img src="https://mintcdn.com/moengage-docs-limits-personalize/rtSLSROQ2XLKNDFn/images/image4.png?fit=max&auto=format&n=rtSLSROQ2XLKNDFn&q=85&s=8f97258df355d26a579b79024948b9e3" alt="Image4" width="1608" height="894" data-path="images/image4.png" />
   </Frame>
5. Copy the required lines or all lines in the Logcat, paste them on a text file, and share the file with MoEngage support team.

## Essential Logs

When browsing the logs, you can search for a few keywords to understand what is happening with the various services that MoEngage offers. Please note that verbose logs for MoEngage SDK has to be enabled for keywords to show up.

### Data tracking

 

<img src="https://mintcdn.com/moengage-docs-limits-personalize/KM23fxYlA_Dmvugi/images/datatracking.png?fit=max&auto=format&n=KM23fxYlA_Dmvugi&q=85&s=68d60054a2708710665463568ddb3053" alt="Datatracking" width="3440" height="538" data-path="images/datatracking.png" />

 

**Search string** - sdk/report

**Occurrence** - You can see this string multiple times, and this log gets printed when the app is gone to the background and killed state. There are other cases when this log can be printed, but we will stick to these two conditions for now as we can easily perform background or kill actions. This line is seen 3 seconds after the app goes into the background or killed state.

**Description**

This log line indicates that the API call has been made to MoEngage servers and has succeeded. This API call is dependent on the proper integration of the lifecycle process. You might not see this line when the app goes into the background or killed state if the lifecycle observer isn't properly registered. Troubleshooting article - [How to debug lifecycle issues](/developer-guide/android-sdk/troubleshooting-and-faqs/troubleshooting-and-faqs#why-is-lifecycle-process-library-important).

### Push Token

<img src="https://mintcdn.com/moengage-docs-limits-personalize/NRph7D7zdnGvVFwM/images/pushtoken.png?fit=max&auto=format&n=NRph7D7zdnGvVFwM&q=85&s=706b4942a64bd7966e4d6a25953553e2" alt="Pushtoken" width="3456" height="946" data-path="images/pushtoken.png" />

**Search string** - push\_id

**Occurrence** - This string **push\_id** can be seen in sdk/report API call as part of the params. There are other cases when push\_id is sent to MoEngage servers, but since we can easily take the app to background state, we are mentioning only this case here.

**Description**

If this parameter is present and not empty, it indicates that the push token was properly acquired by MoEngage SDK and synced with MoEngage backend servers. You might not see push\_id or empty value if there are problems with your FCM project setup. Please go through the [push integration](/developer-guide/android-sdk/push/basic/push-configuration) steps properly.

### InApps - Sync

<img src="https://mintcdn.com/moengage-docs-limits-personalize/vRTERkSvb-svBYDt/images/sync.png?fit=max&auto=format&n=vRTERkSvb-svBYDt&q=85&s=7c535300217f7b64cb1760e5038d2e50" alt="Sync" width="3456" height="880" data-path="images/sync.png" />

**Search string** - inapp/live and find get the line that has getResponse()

**Occurrence** - When the app is opened from the killed state. There are other cases when this API call is made, but we can easily kill the app and open it to see this call, so we are mentioning only this case here.

**Description**

This log line indicates that MoEngage SDK has made an API call to its backend servers to fetch the valid InApps or Nudges for the user. This API call is essential for InApps or Nudges to work as expected and depends on properly registering the lifecycle process. If you don't see this call once you open the app from killed state, go through the troubleshooting article here - [How to debug lifecycle issues.](/developer-guide/android-sdk/troubleshooting-and-faqs/troubleshooting-and-faqs#why-is-lifecycle-process-library-important)

### InApps - display not shown

<img src="https://mintcdn.com/moengage-docs-limits-personalize/KM23fxYlA_Dmvugi/images/display.png?fit=max&auto=format&n=KM23fxYlA_Dmvugi&q=85&s=29337bf9d29b7d66f08d001c431ad25e" alt="Display" width="3456" height="526" data-path="images/display.png" />

**Search string** - Cannot show

**Occurrence** - This string can be seen when the MoEngage SDK can't show the InApp.

**Description**

This log line indicates that Inpps aren't shown to the user, and the reason for not showing the InApp is also mentioned at the end of the log line.

### Exceptions

<img src="https://mintcdn.com/moengage-docs-limits-personalize/KM23fxYlA_Dmvugi/images/exceptions.png?fit=max&auto=format&n=KM23fxYlA_Dmvugi&q=85&s=f79f7b1f8f7918ca79ccc64b2f6a971e" alt="Exceptions" width="3456" height="526" data-path="images/exceptions.png" />

While browsing through MoEngage SDK logs, you might encounter error/exception logs, as shown in the above image. It's important to ensure no such logs for smoother integration of MoEngage SDK. Kindly contact our team via support tickets to identify the fix for these issues. We are also listing some common exceptions and their fixes [here](/developer-guide/android-sdk/troubleshooting-and-faqs/troubleshooting-exceptions).
