Enable debug logging for Dynatrace Android Gradle plugin or OneAgent SDK

Activate debug logging for Dynatrace Android Gradle plugin or OneAgent SDK.

Do not enable debug logging for your production applications.

Use debug flags explicitly for debugging purposes, not for production. Remove these flags when building your PlayStore or production app because additional logging might slow down your mobile app or write sensitive information into the device logs.

Activate debug logging mode

You can activate the debug logs via the Dynatrace Android Gradle plugin or OneAgent SDK for Android.

Dynatrace Android Gradle plugin

Enable debug logging via the agentLogging property.

OneAgent SDK

Enable debug logging using the ConfigurationBuilder.withDebugLogging(boolean) method.

Retrieve logs from the device

OneAgent for Android uses the default log framework from Android. You can use the Logcat window in Android Studio or the command-line logcat tool to view log messages.

To retrieve the Android logs via the Logcat window in Android Studio

  1. Connect your device to your computer or run the emulator.

    Note that your device should be set up for development.

  2. In Android Studio, select View > Tool Windows > Logcat, and then select your device.

  3. Create a filter.

  4. Launch the instrumented app by using the debug flags.

  5. Copy and paste the log lines into a text file.