SLF4J binding for the Android logger
- Does not support SLF4J markers, these will be ignored.
- Compatible with API version 1.
- Loads properties from
/uk/uuid/slf4j/android/config.properties
. - Configuration can be applied per logger prefix or set the default by omitting the logger prefix.
- Set the tag for the specified logger prefix:
tag.logger-prefix=TagName
- Set the log level for the specified logger prefix:
level.logger-prefix=SUPPRESS|ERROR|WARN|INFO|DEBUG|VERBOSE|NATIVE
- Show the logger name in short, compact, long format, or show caller stack frame:
showName.logger-prefix=false|short|compact|long|caller
- Show the current thread:
showThread.logger-prefix=true|false
- Set the tag for the specified logger prefix:
- With no tag configured, logger names are automatically compacted to fit the Android 23 character tag limit.
- The default configuration does not show the logger name or the current thread.
- The default log level is NATIVE (use the Android log level for the tag).
- The Android log level for each tag is cached at the time the logger is constructed.
tag=ExampleApplication
showThread=true
showName=short
- Available as
uk.uuid.slf4j:slf4j-android
. - The configuration file when using the standard project layout should be located at
src/main/resources/uk/uuid/slf4j/android/config.properties
. - Note: There is a bug in android-maven-plugin that makes the runtime scope unusable.
pom.xml:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>uk.uuid.slf4j</groupId>
<artifactId>slf4j-android</artifactId>
<version>2.0.7-0</version>
</dependency>
build.gradle:
dependencies {
compile 'org.slf4j:slf4j-api:2.0.7'
compile 'uk.uuid.slf4j:slf4j-android:2.0.7-0'
}