Setup Android
🚧 The Android SDK is still in Beta.
Installation​
The SDK requires a minSDKVersion of 26 (Android 8)
Add the following to settings.gradle.kts
(project root).
- Kotlin
- Groovy
pluginManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
}
}
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
}
}
// Add to your settings.gradle | minSdkVersion 26 or higher is required (Android 8)
pluginManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://android-sdk.logdog.app")
}
google()
mavenCentral()
}
}
Add the LogDog dependency to your app's build.gradle
(app) file:
- Kotlin
- Groovy
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
}
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​
- Create an account at client.logdog.app
- 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:
- Place a log statement like
LogDog.i("LogDog","Hello from LogDog!")
- Run your app
- 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​
- Initialize LogDog as early as possible in your app lifecycle
- Use appropriate log levels for different types of information
- Add relevant metadata to help with debugging
- Handle sensitive information appropriately
- Monitor network usage and adjust configuration if needed
Troubleshooting​
If you're not seeing logs in the dashboard:
- Verify if your API key is correct
- Check that
LogDog.initialize()
andLogDog.start()
have been called - Ensure you have network connectivity on both desktop and mobile
- 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!