Benefits
What you gain over plain android.util.Log — and why teams standardize on logback-android.
Log beyond logcat
android.util.Log can only write to logcat, which is lost when the device
disconnects. logback-android persists logs to rolling files or SQLite on the device, ships
them to a remote socket or syslog collector, or even emails critical errors — simultaneously.
Turn logging up or down without a release
Levels, destinations, and formats are defined in logback.xml. Ship debug
builds that log verbosely to files and release builds that only record warnings — same code,
different config.
Per-package control
Silence a chatty third-party library with one line
(<logger name="com.noisy.lib" level="WARN"/>) while your own packages
keep logging at DEBUG. No more if (BuildConfig.DEBUG) sprinkled
everywhere.
Rich, consistent formatting
Pattern layouts give every message a timestamp, thread, level, and logger name
automatically — for example %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n.
Formatting lives in config, not in every call site.
Rolling files that manage themselves
Time- and size-based rolling policies cap how much storage logs consume, and old files are pruned automatically. No hand-rolled file management code to write, test, and debug.
Parameterized, cheap log calls
SLF4J's log.debug("user {} logged in", id) defers string construction until
the message is actually enabled, so disabled log statements cost almost nothing at runtime.
One API across client and server
Backend Java/Kotlin code and shared libraries already log via SLF4J. With logback-android, the same statements — and the same configuration concepts — work in your app, your services, and your tests.
Filters, MDC, and markers
Inherit logback's advanced machinery: threshold and evaluator filters, mapped diagnostic context (MDC) for per-request metadata, and markers for routing special events to dedicated appenders.
logback-android vs. android.util.Log
| Capability | android.util.Log | logback-android |
|---|---|---|
| Log to logcat | Yes | Yes |
| Log to files with rotation | — | Yes (time- and size-based) |
| Log to SQLite / socket / syslog / email | — | Yes |
| Configure without code changes | — | Yes (XML in assets) |
| Per-package log levels | — | Yes (logger hierarchy) |
| Automatic timestamps / thread / caller info | — | Yes (pattern layout) |
| Parameterized messages | — | Yes (SLF4J {}) |
| Works with SLF4J-based libraries | — | Yes |
Ready to try it? Head to the getting-started guide or generate a config in the Config Editor.