Use slf4j-api in your application to write logging statements as shown in the example below.
package com.example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import android.os.Bundle;
import android.app.Activity;
public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    // SLF4J
    Logger LOG = LoggerFactory.getLogger(MainActivity.class);
    LOG.info("hello world");
  }
}
                
            OR add a Gradle dependency:
dependencies {
  compile 'org.slf4j:slf4j-api:1.7.25'
  compile 'com.github.tony19:logback-android:2.0.0'
}