Skip to main content

Setup Android

🚧 The Android SDK is still in Beta.

Installation​

info

The SDK requires a minSDKVersion of 26 (Android 8)

Add the following to settings.gradle.kts (project root).

pluginManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
}
}

dependencyResolutionManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
}
}

Add the LogDog dependency to your app's build.gradle (app) file:

plugins {
id("com.modrena.logdog.plugin") version "1.0.X" // Don't forget to set the desired version
}

dependencies {
implementation("com.modrena.logdog:logdog-sdk:1.0.X") // Don't forget to set the desired version
}

API Key​

  1. Create an account at client.logdog.app
  2. Copy your API key from the project settings

Initialize LogDog​

Add the following code to your Application class:

import com.modrena.logdog.LogDog
import com.modrena.logdog.LogDogConfig

class YourApplication : Application() {
override fun onCreate() {
super.onCreate()
LogDog.initialize(this)
val config = LogDogConfig(
apiKey = "YOUR_API_KEY",
logs = true,
network = true,
events = true
)
LogDog.start(config)
LogDog.i("LogDog","Hello from LogDog!")
}
}

Verification​

To verify that LogDog is properly installed and configured:

  1. Place a log statement like LogDog.i("LogDog","Hello from LogDog!")
  2. Run your app
  3. Check the LogDog dashboard – you should see the log appear immediately

Available Methods​

Setup and Configuration​

// Set custom device name
LogDog.setCustomDeviceName(name = "Pixel 7 Test Device")

Logging​

// Basic logging
LogDog.l("LogDog", "Message")
LogDog.i("LogDog", "Info message")
LogDog.w("LogDog", "Warning message")
LogDog.e("LogDog", "Error message")

Event Tracking​

// Send custom event
LogDog.logEvent(
name = "button_tap",
category = "ui_interaction",
payload = mapOf(
"button_id" to "submit_button",
"screen" to "checkout"
)
)

Debug Options​

// Enable/disable debug window in production builds (active by default)
LogDog.setDebugShake(value = true)

// Get SDK version
LogDog.getVersion()

// Delete device ID
LogDog.deleteDeviceId()

Throttling Requests​

To debounce requests and send them in bulk, LogDog offers setRequestSendTimeout(timeoutInMs: Int):

LogDog.setRequestSendTimeout(timeoutInMs = 10_000) // 10s
LogDog.getRequestSendTimeout()

If set, it will delay requests up to the defined time and then send multiple requests in bulk.
This is a debounce mechanism — every new request resets the timeout.

Deactivating the Plugin​

The LogSDK consists of a Library and a Gradle Plugin.
The Gradle Plugin enables the interception of HTTP requests. You can deactivate the plugin by adding the following to your gradle.properties file:

logDogPluginDisabled=true

With this line, the LogDog Plugin will not run.
You can still use LogDog's logging features but request interception will no longer work.

Best Practices​

  1. Initialize LogDog as early as possible in your app lifecycle
  2. Use appropriate log levels for different types of information
  3. Add relevant metadata to help with debugging
  4. Handle sensitive information appropriately
  5. Monitor network usage and adjust configuration if needed

Troubleshooting​

If you're not seeing logs in the dashboard:

  1. Verify if your API key is correct
  2. Check that LogDog.initialize() and LogDog.start() have been called
  3. Ensure you have network connectivity on both desktop and mobile
  4. Confirm logs are not being filtered by your configuration

Support​

If you have questions, send us an email at support@logdog.app. We're happy to help!