This example belongs to an article published in Java Magazin 9.17: Android Logging for Java Professionals – SLF4J and Logback in Android.
The original article (
An example that shows some possibilities of using logback-android:
- The app issues log statements when pressing a button and displays those in a the main text view (see MainActivity).
- There is an exemplary logback.xml,
- writing to a file (that is rolled over daily) and
- logcat. It also
- forwards JUL to SLF4J/logback.
- The app also provides a PreferencesDeveloperActivity / preferences_developer.xml that allows for
- The central logback-android logic is encapsulated in a separate JAR file: logback-android-utils
Logback android in the Context of SLF4J
- A JDK defined as Jenkins tool (see Jenkinsfile for name of JDK tool)
- Android SDK installed on Jenkins salve, matching the
buildToolsVersionas defined in app/build.gradle
- Optional: You can add a build parameter
RECIPIENTSthat contains a comma-separated list of all email recipie