---
title: "Timber"
description: "Learn more about the Sentry Timber integration for the Android SDK."
url: https://docs.sentry.io/platforms/android/integrations/timber/
---

# Timber | Sentry for Android

##### Did you mean logs instead?

This integration captures Timber logs as breadcrumbs and error events (great for error context!). But if you need to search and query your logs across your entire application, use [Sentry Logs](https://docs.sentry.io/platforms/android/logs.md) instead. Timber logs at or above the `minLogsLevel` are automatically sent as Sentry Logs when enabled. See the [Support With Sentry Logs](https://docs.sentry.io/platforms/android/integrations/timber.md#support-with-sentry-logs) section below.

The `sentry-android-timber` library provides [Timber](https://github.com/JakeWharton/timber) support for Sentry via [Timber Tree](https://github.com/JakeWharton/timber/blob/10f0adce3921ad2929ddf2f3b7fecda2cf3148a5/timber/src/main/java/timber/log/Timber.kt#L20) that sends events and breadcrumbs to Sentry. Once this integration is configured you can use Timber's static API.

The source can be found [on GitHub](https://github.com/getsentry/sentry-java/tree/master/sentry-android-timber/src/main/java/io/sentry/android/timber).

## [Auto-Installation With the Sentry Android Gradle Plugin](https://docs.sentry.io/platforms/android/integrations/timber.md#auto-installation-with-the-sentry-android-gradle-plugin)

### [Install](https://docs.sentry.io/platforms/android/integrations/timber.md#install)

Starting from version `3.1.0`, the Sentry Android Gradle plugin will automatically add the `sentry-android-timber` dependency. The plugin will only add the `sentry-android-timber` dependency if a `timber` dependency was discovered on the classpath.

Add the Sentry Android Gradle plugin in `build.gradle`:

```groovy
plugins {
  id "io.sentry.android.gradle" version "6.4.0"
}
```

Then, initialize the [Android SDK](https://docs.sentry.io/platforms/android.md#configure).

The Android SDK automatically adds the `SentryTimberIntegration` if the `sentry-android-timber` dependency was found on the classpath. The integration is added with `minEventLevel` set to `ERROR`, `minBreadcrumbLevel` and `minLogsLevel` set to `INFO`.

However, you can still override the default behaviour by adding your own instance of the `SentryTimberIntegration`. For that, refer to the [manual installation](https://docs.sentry.io/platforms/android/integrations/timber.md#configure) section below.

### [Disable](https://docs.sentry.io/platforms/android/integrations/timber.md#disable)

If you want to disable the Timber integration (to not exceed your event quota, for example), but keep using other auto-installation features, remove the `sentry-android-timber` dependency from the app configurations in `app/build.gradle`:

```groovy
configurations.configureEach {
  exclude group: "io.sentry", module: "sentry-android-timber"
}
```

## [Manual Installation](https://docs.sentry.io/platforms/android/integrations/timber.md#manual-installation)

### [Install](https://docs.sentry.io/platforms/android/integrations/timber.md#install-1)

To add the Timber integration, [manually initialize](https://docs.sentry.io/platforms/android/manual-setup.md#configuration-via-sentryoptions) the Android SDK, then add the `sentry-android-timber` dependency. Using Gradle:

```groovy
implementation 'io.sentry:sentry-android:8.38.0'
implementation 'io.sentry:sentry-android-timber:8.38.0'
```

### [Configure](https://docs.sentry.io/platforms/android/integrations/timber.md#configure)

Configuration should happen as early as possible in your application's lifecycle.

```kotlin
import io.sentry.android.core.SentryAndroid
import io.sentry.android.timber.SentryTimberIntegration
import timber.log.Timber
// import BuildConfig

SentryAndroid.init(this) { options ->
  if (!BuildConfig.DEBUG) {

    // default values:
    // minEventLevel = ERROR
    // minBreadcrumbLevel = INFO
    // minLogsLevel = SentryLogLevel.INFO,
    options.addIntegration(
      SentryTimberIntegration(
        minEventLevel = SentryLevel.ERROR,
        minBreadcrumbLevel = SentryLevel.INFO,
        minLogsLevel = SentryLogLevel.INFO
      )
    )
  } else {
    Timber.plant(Timber.DebugTree())
  }
}
```

## [Verify](https://docs.sentry.io/platforms/android/integrations/timber.md#verify)

This snippet captures an intentional error, so you can test that everything is working as soon as you set it up:

```kotlin
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import java.lang.Exception
import timber.log.Timber

class MyActivity : AppCompatActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    try {
      throw Exception("This is a test.")
    } catch (e: Exception) {
      Timber.e(e);
    }
  }
}
```

Learn more about manually capturing an error or message, in our [Usage documentation](https://docs.sentry.io/platforms/android/usage.md).

To view and resolve the recorded message, log into [sentry.io](https://sentry.io) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.

## [Support With Sentry Logs](https://docs.sentry.io/platforms/android/integrations/timber.md#support-with-sentry-logs)

Sentry Logs for Timber are supported in Sentry Android SDK version `8.17.0` and above.

Timber logs at or above the `minLogsLevel` captured by Sentry are automatically sent as [Sentry Logs](https://docs.sentry.io/platforms/android/logs.md), if enabled.
