#adb #android #log #logcat #logger


A logging implementation for log which directly writes to the Android logd daemon

12 releases

0.4.2 Jul 20, 2023
0.4.1 Apr 14, 2023
0.3.3 Feb 15, 2023
0.3.2 May 25, 2022
0.1.3 Mar 2, 2021

#320 in Debugging

Download history 115/week @ 2023-08-15 309/week @ 2023-08-22 243/week @ 2023-08-29 374/week @ 2023-09-05 240/week @ 2023-09-12 320/week @ 2023-09-19 404/week @ 2023-09-26 266/week @ 2023-10-03 277/week @ 2023-10-10 414/week @ 2023-10-17 164/week @ 2023-10-24 483/week @ 2023-10-31 152/week @ 2023-11-07 288/week @ 2023-11-14 236/week @ 2023-11-21 341/week @ 2023-11-28

1,042 downloads per month
Used in northstar


766 lines


Crates.io Build Status Docs

This logger writes logs to the Android logd, a system service with multiple ringbuffers for logs and evens. This is normally done via liblog (a native Android lib). Instead of using liblog, this crate writes directly to the logd socket with the trivial protocol below. This logger is written in pure Rust without any need for ffi.

On non Android system the log output is printed to stdout in the default format of logcat.


Add this to your Cargo.toml

android-logd-logger = "0.4.0"

Initialize the logger with a fixed tag and the module path included in the log payload.

fn main() {

    trace!("trace message: is not logged");
    debug!("debug message");
    info!("info message");
    warn!("warn message");
    error!("error message");

To write android logd "events" use event or event_now, e.g:

android_logd_logger::write_event_now(1, "test").unwrap();


Writing to the logd socket is a single point of synchronization for threads. The android-logd-logger can be configured with the tls feature to maintain one socket per thread or use a single socket for the whole process. Use the features tls if you want less interference between threads but pay for one connection per thread.


Licensed under either of


~117K SLoC