logback-android

Advanced logging for Android apps

License

License

Categories

Categories

Logback Application Layer Libs Logging
GroupId

GroupId

com.github.tony19
ArtifactId

ArtifactId

logback-android-classic
Last Version

Last Version

1.1.1-6
Release Date

Release Date

Type

Type

jar
Description

Description

logback-android
Advanced logging for Android apps
Project URL

Project URL

https://github.com/tony19/logback-android
Source Code Management

Source Code Management

https://github.com/tony19/logback-android

Download logback-android-classic

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.tony19/logback-android-classic/ -->
<dependency>
    <groupId>com.github.tony19</groupId>
    <artifactId>logback-android-classic</artifactId>
    <version>1.1.1-6</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.tony19/logback-android-classic/
implementation 'com.github.tony19:logback-android-classic:1.1.1-6'
// https://jarcasting.com/artifacts/com.github.tony19/logback-android-classic/
implementation ("com.github.tony19:logback-android-classic:1.1.1-6")
'com.github.tony19:logback-android-classic:jar:1.1.1-6'
<dependency org="com.github.tony19" name="logback-android-classic" rev="1.1.1-6">
  <artifact name="logback-android-classic" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.tony19', module='logback-android-classic', version='1.1.1-6')
)
libraryDependencies += "com.github.tony19" % "logback-android-classic" % "1.1.1-6"
[com.github.tony19/logback-android-classic "1.1.1-6"]

Dependencies

compile (2)

Group / Artifact Type Version
com.github.tony19 : logback-android-core jar 1.1.1-6
com.github.tony19 : apktool-lib jar 1.4.4-3

provided (2)

Group / Artifact Type Version
com.google.android : android jar 2.1.2
org.slf4j : slf4j-api jar 1.7.21

test (12)

Group / Artifact Type Version
junit : junit jar 4.10
org.mockito : mockito-core jar 1.9.0
org.slf4j : log4j-over-slf4j jar 1.7.21
org.slf4j : slf4j-api jar 1.7.21
dom4j : dom4j jar 1.6.1
org.slf4j : integration jar 1.7.21
org.subethamail : subethasmtp jar 2.1.0
com.icegreen : greenmail jar 1.3
org.slf4j : slf4j-ext jar 1.7.21
org.easytesting : fest-assert jar 1.2
org.hamcrest : hamcrest-junit jar 2.0.0.0
org.robolectric : robolectric jar 3.0

Project Modules

There are no modules declared in this project.

logback-android CircleCI branch Codacy Badge

v2.0.0

Overview

logback-android brings the power of logback to Android. This library provides a highly configurable logging framework for Android apps, supporting multiple log destinations simultaneously:

  • files
  • SQLite databases
  • logcat
  • sockets
  • syslog
  • email

Runs on Android 2.3 (SDK 9) or higher. See Wiki for documentation.

For v1.x, see the 1.x branch.

Quick Start

  1. Create a new "Basic Activity" app in Android Studio.

  2. In app/build.gradle, add the following dependencies:

    dependencies {
      compile 'org.slf4j:slf4j-api:1.7.25'
      compile 'com.github.tony19:logback-android:2.0.0'
    }
  3. Create app/src/main/assets/logback.xml containing:

    <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>
  4. In MainActivity.java, add the following imports:

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
  5. ...and modify onOptionsItemSelected() to log "hello world":

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        Logger log = LoggerFactory.getLogger(MainActivity.class);
        log.info("hello world");
        // ...
    }
  6. Build and start the app.

  7. Open logcat for your device (via the Android Monitor tab in Android Studio).

  8. Click the app menu, and select the menu-option. You should see "hello world" in logcat.

Download

Gradle release

dependencies {
  compile 'org.slf4j:slf4j-api:1.7.25'
  compile 'com.github.tony19:logback-android:2.0.0'
}

Gradle snapshot (unstable)

repositories {
  maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

dependencies {
  compile 'org.slf4j:slf4j-api:1.7.25'
  compile 'com.github.tony19:logback-android:2.0.1-SNAPSHOT'
}

Build

Use these commands to create the AAR:

git clone git://github.com/tony19/logback-android.git
cd logback-android
scripts/makejar.sh

The file is output to: ./build/logback-android-2.0.0-debug.aar

Versions

Version
1.1.1-6
1.1.1-5
1.1.1-4
1.1.1-3
1.1.1-2
1.1.1-1
1.0.10-2
1.0.10-1
1.0.8-1
1.0.7-1
1.0.6-2