# How do I enable logging for Bitmovin's Player SDK for Android?

**URL:** <https://community.bitmovin.com/t/how-do-i-enable-logging-for-bitmovins-player-sdk-for-android/99>\
**Category:** Support\
**Tags:** bitmovin-player, android, logging\
**Created:** [December 29, 2021, 2:25pm UTC](https://community.bitmovin.com/t/how-do-i-enable-logging-for-bitmovins-player-sdk-for-android/99 "2021-12-29T14:25:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon80868541](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon80868541](https://community.bitmovin.com/u/anon80868541)\
**Post date:** [December 29, 2021, 2:25pm UTC](https://community.bitmovin.com/t/how-do-i-enable-logging-for-bitmovins-player-sdk-for-android/99/1 "2021-12-29T14:25:38Z")

</div>

I’m having an issue using Bitmovin’s Player SDK for Android. However I don’t see any logs, so I can’t understand what’s happening. Is there an option to enable logs?

---

<div class="post-metadata">

**Author:** ![Monycky](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@Monycky](https://community.bitmovin.com/u/Monycky)\
**Post date:** [December 29, 2021, 3:20pm UTC](https://community.bitmovin.com/t/how-do-i-enable-logging-for-bitmovins-player-sdk-for-android/99/2 "2021-12-29T15:20:56Z")

</div>

Bitmovin Android Player SDK uses [SLF4J](https://www.slf4j.org/) facade API for logging. So the application has to provide a logger implementation of this API to direct the logs to specific output and control the log output levels. A couple of reference implementation are as below.

> **[GitHub - tony19/logback-android: 📄The reliable, generic, fast and flexible logging...](https://github.com/tony19/logback-android)**
>
> 📄The reliable, generic, fast and flexible logging framework for Android

> **[GitHub - noveogroup/android-logger: Useful logger for Android based on standard...](https://github.com/noveogroup/android-logger)**
>
> Useful logger for Android based on standard android.util.Log class. Simple lightweight (\< 50 Kb) implementation of SLF4J API. Easy but powerful configuration via properties file and some additional helpful logging methods. Easy analogue of popular log4j library.

Quick steps to enable logs using [android-logger](https://github.com/noveogroup/android-logger) are as follows:

1. Add following dependency in your app build.

```auto
dependencies {
  compile 'com.github.tony19:logback-android:2.0.0'
}

```

1. Create app/src/main/assets/logback.xml containing following in your app.

```auto
<configuration>
  <appender name="logcat" class="ch.qos.logback.classic.android.LogcatAppender">
    <tagEncoder>
      <pattern>%logger{12}</pattern>
    </tagEncoder>
    <encoder>
      <pattern>[%-20thread] %msg</pattern>
    </encoder>
  </appender>
  <root level="DEBUG">
    <appender-ref ref="logcat" />
  </root>
</configuration>

```

## Proguard Configuration

When using [Proguard](https://www.guardsquare.com/proguard), the following line must be added to the proguard file:

```auto
-dontwarn org.slf4j.**

```

---

<div class="post-metadata">

**Author:** ![Lukas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/lukas/32/393_2.png) [@Lukas](https://community.bitmovin.com/u/Lukas)\
**Post date:** [May 6, 2022, 4:53am UTC](https://community.bitmovin.com/t/how-do-i-enable-logging-for-bitmovins-player-sdk-for-android/99/3 "2022-05-06T04:53:20Z")

</div>

I know that this has already been answered, but I would like to add a little to this:

While the SLF4J logging facade is currently the official logger in the Android Player SDK it is also very helpful to subscribe to warning and error events on the `Source` and the `Player`:

```auto
        // Attach warning and error listeners to player
        player.on<PlayerEvent.Error> { Log.e("PlayerError", "$it") }
        player.on<PlayerEvent.Warning> { Log.w("PlayerWarning", "$it") }

        // Attach warning and error listeners to source
        source.on<SourceEvent.Error> { Log.e("SourceError", "$it") }
        source.on<SourceEvent.Warning> { Log.w("SourceWarning", "$it") }

```

This can provide you with quick feedback when something is going wrong.

---

<div class="post-metadata">

**Author:** ![Lukas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/lukas/32/393_2.png) [@Lukas](https://community.bitmovin.com/u/Lukas)\
**Post date:** [December 16, 2022, 1:16pm UTC](https://community.bitmovin.com/t/how-do-i-enable-logging-for-bitmovins-player-sdk-for-android/99/4 "2022-12-16T13:16:12Z")

</div>

We have published a [tutorial](https://staging.bitmovin.com/docs/pLAYER/tutorials/how-to-enable-logging-in-the-bitmovin-android-player) that showcases how to do logging with the Bitmovin Android Player SDK.
