SDK documentation
Stream logs, crashes and user feedback to your LogWatcher server. Six SDKs, one API, one wire protocol — pick your platform:
Getting started
You need an application key. Create an account, add an app in the dashboard, and copy the key shown on its card. Every SDK call is tied to that key. Then follow your platform's guide above — the flow is always the same three steps: point the SDK at your server (before init), initialize with the app key, log.
How delivery works
Every SDK implements the same delivery model: log lines are written to a local, wire-ready queue first (SQLite, JSONL file, localStorage or memory depending on the platform), then uploaded in batches — every 5 minutes, or immediately when the queue reaches 200 rows / 64 KiB, in chunks of at most 1000 rows grouped by session. Entries are deleted only after the server acknowledges (at-least-once delivery), the queue is capped at 5 MiB with oldest-first eviction, and platforms with a persistent queue drain leftovers on the next launch — which is what delivers the breadcrumbs leading up to a crash. Android, Flutter and Go gzip large batches.
Remote device control
On every launch the SDK registers the device and receives its remote flags. From the dashboard you can enable log collection for a single device (a misbehaving terminal) while the rest of the fleet stays quiet — no release, no restart loop. To force collection locally regardless of the remote flag:
// same pair on every platform (Go: SetForceEnabled / ForceSendOnce)
LogWatcher.setForceEnabled(true) // override the remote toggle
LogWatcher.forceSendOnce() // flush the queue right now
Platform matrix
| SDK | Package | Runs on | Queue | Crash capture |
|---|---|---|---|---|
| Android | gr.fintechiq.logwatcher (AAR) | Android 4.1+ | SQLite (persistent) | uncaught-exception handler |
| iOS | LogWatcher (SwiftPM) | iOS 12+, macOS 10.15+ | JSONL file (persistent) | NSUncaughtExceptionHandler |
| JavaScript | @fintechiq/logwatcher | Browsers, Node ≥18 | localStorage / memory | onerror + unhandledrejection / process hooks |
| Svelte | @fintechiq/logwatcher-svelte | Svelte, SvelteKit | as JavaScript | SvelteKit handleError + browser globals |
| Flutter | logwatcher_sdk (pub) | Flutter mobile/desktop, Dart CLI | JSONL file / memory | recordError + FlutterError hooks |
| Go | logwatcher-sdk-go | Go 1.21+ services (GCP-aware) | memory (bounded) | RecoverPanic / ReportPanic |
HTTP API reference
Everything every SDK does goes through five endpoints. Authentication is the
X-App-Token header carrying your application key.
| Endpoint | Purpose | Notes |
|---|---|---|
POST /app/device-status | Register a device, fetch remote enable flags | sent on every launch |
POST /session | Start a session | returns the numeric session id |
POST /log/batch | Upload a batch of log lines | X-App-Session header; token must match the session's app; body may be gzip (Content-Encoding: gzip) |
POST /issue | Issues, crashes, user feedback | discriminated by type |
POST /device/keyvalue | Set one device key-value | typed value |
The full wire protocol is documented in the LogWatcher repository.