Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.34 KB

File metadata and controls

46 lines (32 loc) · 1.34 KB

Datadog Integration for Timber

Getting Started

To include the Datadog integration for Timber in your project, simply add the following to your application's build.gradle file.

dependencies {
    implementation "com.datadoghq:dd-sdk-android-logs:<latest-version>"
    implementation "com.datadoghq:dd-sdk-android-timber:<latest-version>"
}

Initial Setup

  1. Setup RUM monitoring, see the dedicated Datadog Android Log Collection documentation to learn how.

  2. Add DatadogTree to Timber:

    val logger = Logger.Builder()
            .setNetworkInfoEnabled(true)
            .setLogcatLogsEnabled(true)
            .setRemoteSampleRate(100f)
            .setBundleWithTraceEnabled(true)
            .setName("<LOGGER_NAME>")
            .build()
    
    Timber.plant(Timber.DebugTree(), DatadogTree(logger))

That's it, now all your Timber logs will be sent to Datadog automatically.

You can configure the logger's tags and attributes, as explained in the Datadog Android Log Collection documentation

Contributing

Pull requests are welcome, but please open an issue first to discuss what you would like to change. For more information, read the Contributing Guide.

License

Apache License, v2.0