Edit in GitHubLog an issue

Debugging and lifecycle metrics

Debug logging

Debug logging is an optional, but a recommended and critical SDK feature.

By enabling logging, you can ensure that the SDK is working as intended. The following table explains levels of logging available and the purpose they serve:

Log LevelDescription
Error
This is the default log level used by SDK. This log level provides the details about unrecoverable errors that occurred during SDK implementation.
Warning
In addition to the details from Error log level, Warning provides error information during SDK integration. This log level might indicate that a request has been made to the SDK, but the SDK might be unable to perform the requested task. For example, this log level might be used when catching an unexpected, but recoverable, exception and printing its message.
Debug
In addition to the details from the Warning log level, Debug also provides high-level information about how the SDK processes network requests/responses data.
Verbose
In addition to the details from the Debug level, Verbose provides detailed, low-level information about how the SDK processes database interactions and SDK events.

To enable debug logging, use the following methods:

Java

Copied to your clipboard
MobileCore.setLogLevel(LoggingMode.DEBUG);
// MobileCore.setLogLevel(LoggingMode.VERBOSE);
// MobileCore.setLogLevel(LoggingMode.WARNING);
// MobileCore.setLogLevel(LoggingMode.ERROR);

Lifecycle metrics

Lifecycle metrics are an optional, but valuable feature provided by the Adobe Experience Platform SDK. It provides out-of-the-box, application lifecycle information about your app user. A complete list of available metrics is provided in the lifecycle documentation.

These metrics contain information on the app user's engagement lifecycle such as device information, install or upgrade information, and session start and pause times. You may also set additional lifecycle metrics.

Java

With the onResume function, start Lifecycle data collection:

Copied to your clipboard
@Override
public void onResume() {
MobileCore.setApplication(getApplication());
MobileCore.lifecycleStart(null);
}

Setting the application is only necessary on activities that are entry points for your application. However, setting the application on each Activity has no negative impact and ensures that the SDK always has the necessary reference to your application. As a result, you should call setApplication on each of your activities.

You can use the onPause function to pause the lifecycle data collection:

To ensure accurate session and crash reporting, this call must be added to every Activity.

Copied to your clipboard
@Override
public void onPause() {
MobileCore.lifecyclePause();
}

For more information, see the documentation on Lifecycle metrics.

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.