ShizuStore

LogSleuth

shiaho777

0.4.2 · GitHub

Download APK
Development utilities Android 8.0+ 1 week ago Apache-2.0
317 ShizuStore
1.3k GitHub
46 Stars
2 MB Size

More about this app

Powerful root-free logcat viewer and embeddable logging SDK with live streaming, search, filters, crash/ANR detection and session replay.

LogSleuth

A powerful logcat viewer and embedded logging SDK for Android. On a mission to be the easiest and most delightful logging tool on Android.

简体中文

CI Release License Stars Docs Android

Screenshots

Live logcat stream Search & hit jumps Filters & presets
Live Stream Search Filters
Crash & ANR detection Log entry detail Multi-select & copy
Crashes Entry detail Selection
Per-app scope picker Recording sessions Session replay
Scope picker Recording Replay
Guided report & export Save & share Setup & grants
Report Share Setup
Settings & in-app updates Guided tour Embedded SDK sample
Settings Tour SDK Sample

What is LogSleuth?

LogSleuth is an open-source (Apache-2.0) Android logging toolkit with two halves that work together:

  • The viewer app — a polished, Logcat-style live reader for the whole device, written in Kotlin + Jetpack Compose (Material 3). Shizuku, root, or one ADB grant unlocks the device log. Shizuku stays the recommended path when the phone is not rooted.
  • logsleuth-sdk — a drop-in library for your own app that records its logs, crashes and ANRs with zero permissions and zero network, then packages them into a zip your users can send you. LogSleuth the viewer opens those zips directly.

Feature overview

Watch the stream

Feature Details
Live logcat threadtime rows with level colors, pid·tid·uid columns and per-app icons
Buffer rail The right edge draws the whole buffer as a severity fingerprint, with a draggable viewport thumb and a Line N of M readout
Smooth tail-follow Conveyor-style auto-scroll that tracks the arrival rate; a fling up detaches, a fling back re-pins
Pause & buffer Freeze the display while lines keep buffering underneath — the banner counts what's waiting, under the filter you are actually using
Search Query across the whole buffer: hit counter, highlighted matches, prev/next jumps
Jump controls FABs to snap to the oldest buffered line or back to the live tail
Engine chip Streaming / Connecting / Stopped / Error at a glance — with the real cause (e.g. logcat exited 1) shown when it fails; auto-reconnects with backoff
Restart logging Overflow action that reconnects a wedged stream, keeping the resume stamp so the ring buffer is not dumped again

Narrow it down

Feature Details
Filters Level threshold (V–A), tag, keyword, exclude-pattern, regex toggle — combinable
Filter presets Save a filter combo, reapply it later; presets manage their own screen
Filter editor Pick a package and an allowed level set; creating a filter from a log line opens the editor prefilled instead of saving a fixed rule
Per-app filter Chip over the stream filters to one app (package names need the uid column, so Shizuku or root)
App picker Installed-app list with icons and per-app line stats

Act on what you see

Feature Details
Entry detail Tap a row for the full message, pid/tid/uid, copy message or raw line
Multi-select Long-press a row, tap to extend the range, copy the whole block
Clear / save by scope Wipe or snapshot everything, or check the apps you want in a two-pane picker with per-app stats
Session snapshot Save the current buffer as a session in one tap

Record & replay

Feature Details
Background recording Foreground service with a live line-count notification (Stop / Bookmark actions)
Quick Settings tile "Record logs" tile shows the live count while active
Floating bubble Optional overlay with record / bookmark / hide controls over other apps (needs the overlay permission)
Bookmarks Timestamp "it happened NOW" during a recording — visible in the session's Bookmarks tab
Auto-stop limits Configurable size cap (8–512 MB, default 64) and duration cap (0–24 h, default unlimited)
Pre-start backfill A recording can include the lines buffered before you hit record
Session replay Reopen any session — Logs / Crashes / Bookmarks tabs, same filters and search as the live stream
Manage sessions Swipe-to-delete with Undo; every session can be shared again later

Crash & ANR detection

Feature Details
Live detection FATAL EXCEPTION, native Fatal signal and ANR signatures flagged while streaming or recording
In-app event list Crashes grouped by app (icon, name, count). Search, sort, and open one app's stack, version, and the surrounding lines. Delete one app's crashes with Undo
Crash search Search the stack and the saved surrounding logs, with previous/next, a hit counter, and the current match scrolled into view. Back closes the search before leaving the page
Ignore an app Ignore or un-ignore the crashing package from the crash screen itself
Notifications Save and notify are separate for Java crashes, native crashes, and ANRs. Each app can have its own channel, so muting one in system settings keeps the record. The alert shows the stack, copies it, and opens that crash
Surrounding logs Up to 200 lines from the moment of the crash are stored beside it and included in the share zip

Reports, export & import

Feature Details
Report wizard Three steps: pick the misbehaving app → reproduce while LogSleuth records → share ZIP/TXT or keep it in Sessions. A crash in the target app is flagged automatically
Export Sessions and the report share as .txt or .zip (the zip bundles device info). A crash shares as plain text, or as a file when the stack is too big for the share sheet
Import Open .zip/.txt/.log from a file manager or share sheet — LogSleuth renders it as a session (this is also how SDK exports arrive)

Quality-of-life

Feature Details
Guided tour A 17-step hands-on tour that drives the real UI — replay it anytime from Settings → About
Setup wizard Shizuku, an opt-in root card, and a copyable ADB grant, re-checkable in place
Bilingual English & 简体中文, plus an in-app language override
Themes & text System / Light / Dark themes; Compact / Default / Comfortable log text sizes
In-app updates GitHub Releases check, release notes, resumable APK download (pause/resume/cancel), one-tap install, version history
Tunable buffer On-screen ring buffer from 1,000 to 200,000 entries (default 20,000). Optional cold start that follows only new lines; a reconnect still continues from the last line
Log rows Optional full lines instead of an 8-line clamp. Search has a match-case toggle on the search bar
Sessions Rename any session from the list or its detail screen
Restore defaults One button in Settings puts every preference back to its default — after a confirmation that says what is kept
Community The QQ group and the Bilibili space are one tap away at the bottom of Settings
Background watch Crash watch that keeps running off screen — with a specialUse foreground service, so it no longer trips the Android 15 time limit

Embedded SDK (logsleuth-sdk)

For app developers — everything above, pointed at your app's process:

Capability Details
Zero requirements No permissions, no network, no accounts — an app can always read its own logs
Capture Own-process logcat thread, Java crash handler (chained to the previous one), main-thread ANR watchdog
Storage Ring-buffered log files (default 3 × ≤2 MB), automatic rotation
Privacy addRedaction(Regex) strips secrets from recorded logs
Callbacks Sleuth.onCrash { … } — fires on next start by default, or immediately if you prefer
Sharing Sleuth.shareLogs(activity) zips logs + device info + metadata and opens the system share sheet

Getting started

1. Install

Grab the APK from Releases and install it (Android 8.0+ / API 26, ~2.4 MB).

2. Grant log access

Since Android 4.1, apps cannot read other apps' logs — a platform rule that applies to every logcat app. Any one of these grants is enough:

  1. Shizuku (recommended) — no root, no PC needed on Android 11+ via Wireless Debugging. Install Shizuku, start it once, and authorize LogSleuth. This also unlocks per-app filtering.
  2. Root — if the phone already runs Magisk, KernelSU, or APatch, turn root on in the setup wizard. LogSleuth does not exec su until you ask, so an unrooted phone never sees a grant dialog. Root reads the same full log as Shizuku, including per-app filtering. Auto mode still prefers Shizuku when both are available; Settings can put root first.
  3. ADB grant — with a PC, run once. The permission stays until you uninstall:
    adb shell pm grant io.github.shiaho777.logsleuth.app android.permission.READ_LOGS
    
    On Android 13 and later this grant is not a background log source. Android only shows the approval dialog while LogSleuth is on screen, and a start from the background is refused and remembered for about a minute. An already-approved stream keeps running after you leave. Shizuku and root are not affected, including the boot crash watch.

The setup wizard walks you through these on first launch and can be reopened any time from Settings → Log access → "Open setup guide".

3. Take the tour

On first run a 17-step coach-mark tour drives the real UI — it opens the filter bar, pauses the stream, types a search query, and pops the scope picker for you. Skip it or replay it later from Settings → About → "Replay guided tour".

Remote device setup covers reading logs from a second device over classic TCP ADB.

Everyday workflows

  • "The app keeps crashing for a user" → Report tab → pick the app → start recording → hand them the phone → Stop & share. Crashes inside the window are flagged and attached automatically.
  • "It's too noisy" → unfold the filter bar, pick only Warn and Error (or any level set) and a tag or keyword — or filter by app (Shizuku or root). Save the combo as a preset.
  • "I need to mark when it happened" → enable Floating controls (needs the overlay permission) or use the Quick Settings tile: record + bookmark without leaving the app under test.
  • "I got a log zip / txt" → open it with LogSleuth or use Import on the Sessions tab — it lands as a replayable session.
  • "That line matters" → tap its ℹ icon for the full message and copy buttons; long-press to multi-select and copy a whole block.

Embedding the SDK

For a GitHub release that includes a logsleuth-sdk-<version>-maven.zip asset, add the public Maven repository and use that release's version.

dependencyResolutionManagement {
    repositories {
        maven {
            url = uri("https://shiaho777.github.io/LogSleuth/maven/")
            content { includeModule("io.github.shiaho777.logsleuth", "logsleuth-sdk") }
        }
    }
}
implementation("io.github.shiaho777.logsleuth:logsleuth-sdk:<version>")

You can also unzip the Maven asset and point maven { url = uri(...) } at the extracted directory. For a source checkout, implementation(project(":sdk")) continues to work.

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        Sleuth.init(this)   // capture starts immediately — no permissions
    }
}

// Anywhere in your app — e.g. a "send logs" support button:
Sleuth.shareLogs(activity)   // opens the system share sheet with a zip

Configuration via SleuthConfig.Builder:

Option Default Meaning
tagFilter(String) null (all) Record only lines whose tag contains it (plus all ERROR lines)
maxFiles(Int) 3 Ring-buffer file count, 1–20
maxFileBytes(Long) 2 MB Rotate after this many bytes per file (min 64 KB)
captureLogcat(Boolean) true Set false to record crashes/ANRs only
watchAnr(Boolean) true Main-looper heartbeat ANR watchdog
onCrashInvokedOnNextStart(Boolean) true Deliver the crash callback on next init instead of at crash time
addRedaction(Regex) — Extra patterns stripped before writing to disk

Full API:

Sleuth.init(context, SleuthConfig.Builder().tagFilter("net").build())
Sleuth.onCrash { report -> /* queue it — runs on next start by default */ }
Sleuth.log("Checkout", "order=42 placed")       // injected into the stream
Sleuth.logException("Checkout", throwable)
val files: List<File> = Sleuth.logFiles()       // raw ring-buffer files
Sleuth.shareLogs(activity)

The zip contains device.txt (manufacturer/model/Android version), meta.txt and the log files — and LogSleuth the viewer opens it natively, so your support flow is "send me the zip" → they open it → you replay it.

Architecture

LogcatSource (local READ_LOGS / Shizuku shell / root shell)
  → LogcatEngine (single owner of the logcat process, auto-reconnect)
      ├→ Stream UI (level colors, filters, search, pause/buffering)
      ├→ RecordingManager (foreground service → session files + Room)
      └→ CrashDetector (FATAL EXCEPTION / Fatal signal / ANR → events + notifications)

logsleuth-sdk (embedded in a host app — zero permissions, zero network):
  Sleuth.init → own-process logcat capture + crash handler + ANR watchdog
              → ring-buffered log files (with secret redaction)
              → one-tap zip share (opens in the viewer for replay)

Permissions

Everything the app asks for, and why:

Permission Used for
READ_LOGS Device log when you use the ADB grant. On Android 13+ a new logcat starts only while LogSleuth is on screen. Shizuku and root read logs through a shell instead
moe.shizuku…API_V23 Talking to the Shizuku service
FOREGROUND_SERVICE + …_SPECIAL_USE Keeping the crash watch and background recording alive
POST_NOTIFICATIONS Recording status, crash/ANR alerts, auto-stop notices
SYSTEM_ALERT_WINDOW Floating record/bookmark bubble — only if you enable it
RECEIVE_BOOT_COMPLETED Restarting the crash watch after a reboot — only if you left it on
INTERNET Update checks against GitHub Releases only — no analytics, no ads
REQUEST_INSTALL_PACKAGES Installing downloaded APK updates

The SDK itself declares no permissions at all — it only ever reads its host app's own logs.

Project structure

app/      The LogSleuth viewer app (Kotlin + Jetpack Compose, Material 3)
sdk/      logsleuth-sdk — the embeddable, zero-permission logging library
sample/   Demo app showing SDK integration

Build from source

Requires JDK 17+ and Android SDK platform 36.

git clone https://github.com/shiaho777/LogSleuth.git
cd LogSleuth
./gradlew assembleDebug          # app + sdk + sample
./gradlew test                   # unit tests
python3 scripts/check_string_parity.py   # bilingual string gate (runs in CI)

Documentation

The documentation site is published at shiaho777.github.io/LogSleuth:

Section URL Covers
Guide /guide/ Getting started, log access, filters and rules, recording and crashes
简体中文 /zh/guide/ The same guide in Chinese
Developer /developer/ Architecture, change recipes, the release runbook

The site source lives in docs/; run it locally with cd docs && npm install && npm run dev.

Download

  • GitHub Releases (see Releases page)
  • F-Droid (planned after first public release)
  • Google Play (planned)

Contributing

See CONTRIBUTING.md. Bug reports and feature requests are welcome via GitHub Issues.

Contact

Platform Link
GitHub github.com/shiaho777/LogSleuth
Bilibili space.bilibili.com/2127032909
QQ Group 1127256026 — tap to join

License

Apache-2.0

Close

How Shizuku is used

Can stream full device logs live with search, filtering, crash detection and session recording via `logcat` through Shizuku.

This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.

How this app uses Shizuku

Shizuku is used to run logcat with shell privileges so the app can read full device logs without a PC connection.

  • Stream live logs: watch system wide log output in real time, powered by the logcat shell command through Shizuku.
  • Search and filter logs: narrow the live stream by level, tag, keyword and exclusion rules plus per app filtering using the uid column, collected with the logcat shell command through Shizuku.
  • Detect crashes and freezes: spot native crashes and app freezes from the crash and events buffers, collected with the logcat shell command through Shizuku.
  • Record log sessions: save log streams for later replay, bookmarks and reports using the same logcat shell command through Shizuku.

Android APIs or commands used

  • logcat -b main -b system -b crash -b events -v threadtime -v uid
  • logcat -T

Notable details

Works without Shizuku via the READ_LOGS permission (grantable over ADB), which runs the same logcat locally.

Close

Changelog

What's new for version 0.4.2

LogSleuth 0.4.2 — a readability and usability pass over the live stream.

versionName 0.4.2, versionCode 13.

Requires Android 8.0 (API 26)+.

Improved

  • Log colors are readable in light theme. Level colors used to be one bright set tuned for dark backgrounds — green and orange text was hard to read on white. Both themes now have their own palette, every color checked for contrast, and the level badge letter automatically picks black or white so it stays legible too. (#185, closes #184)
  • Entry details sit beside the list on wide screens. On landscape phones, tablets and foldables (including split-screen), tapping a line opens a docked panel on the right instead of a sheet covering the stream — long stacks scroll inside the panel while the copy and filter buttons stay in view. Phones keep the bottom sheet. (#185, closes #184)
  • Smoother scrolling under heavy log traffic. Timestamp formatting is now cached instead of redone on every redraw, and the list recycles rows more efficiently, so fast streams stutter less. (#185, closes #184)
  • Log rows work with TalkBack. Copying a line no longer requires a long press — it is offered as an accessibility action, the tap is announced for what it does (open details, or extend the selection), and the decorative icon no longer reads as a separate item. (#185, closes #184)
  • Tidier log metadata. The uid and pid/tid columns line up with real spacing instead of space characters, so they stay aligned on every device font. (#185, closes #184)

LogSleuth 0.4.2 —— 实时日志流的一轮可读性与易用性打磨。

versionName 0.4.2,versionCode 13。

需要 Android 8.0(API 26)及以上。

改进

  • 浅色主题下日志颜色看得清了。 级别颜色原先只有一套为深色背景调校的亮色,绿色、橙色文字在白底上很难辨认。现在亮暗主题各有一套经过对比度校验的配色,级别徽章的字母也会自动选黑或白,保证清晰可读。(#185, closes #184)
  • 宽屏上日志详情停在列表旁边。 横屏手机、平板和折叠屏(含分屏)上,点一行日志会在右侧打开停靠面板,不再用弹层盖住日志流——长堆栈在面板内滚动,复制和过滤按钮始终可见。手机竖屏仍是底部弹层。(#185, closes #184)
  • 大量日志涌入时滚动更顺滑。 时间戳格式化改为缓存复用,不再每次重绘都重新计算,列表行回收也更高效,高速日志流下的卡顿更少。(#185, closes #184)
  • 日志行支持 TalkBack。 复制一行不再依赖长按——读屏用户可直接使用无障碍动作,点击会播报实际作用(打开详情或扩展选区),装饰性图标也不再被单独朗读。(#185, closes #184)
  • 日志元信息排列更整齐。 uid 与 pid/tid 列改用真实间距对齐,不再靠空格字符拼凑,任何设备字体下都能对齐。(#185, closes #184)
Close

Permissions

10 permissions requested

  • android.permission.READ_LOGS
  • moe.shizuku.manager.permission.API_V23
  • android.permission.FOREGROUND_SERVICE
  • android.permission.FOREGROUND_SERVICE_SPECIAL_USE
  • android.permission.POST_NOTIFICATIONS
  • android.permission.SYSTEM_ALERT_WINDOW
  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.INTERNET
  • android.permission.REQUEST_INSTALL_PACKAGES
  • io.github.shiaho777.logsleuth.app.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
Close

Sources

2 sources

0.4.2 Universal GitHub · io.github.shiaho777.logsleuth.app
Selected Download
0.3.4 Universal GitHub · io.github.shiaho777.logsleuth.app
Download