Setup Android
Please not that our Android SDK is still in Beta.
Gradle
Installation
Add the following to settings.gradle.kts (project root).
These instructions apply for apps using .kts gradle files.
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
(module) file:
plugins {
id("com.modrena.logdog.plugin") version "1.0.X" // Dont forget to set the desired version
}
dependencies {
implementation("com.modrena.logdog:logdog-sdk:1.0.X") // Dont 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; Is active by default
LogDog.setDebugShake(value = true)
// Get SDK version
LogDog.getVersion(): String
// Delete device ID
LogDog.deleteDeviceId()
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 your API key is correct
- Check that LogDog.initialize() has been called
- Ensure you have network connectivity on desktop and your mobile devices
- Check if any logs are being filtered by your configuration
Next Steps
- Configure LogDog for your specific needs
- Set up network request mocking
Support
If you have questions send us an email via hello@logdog.app. We are happy to help!