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>"
}
-
Setup RUM monitoring, see the dedicated Datadog Android Log Collection documentation to learn how.
-
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
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.