HUB
Sign inSign up

sudhis/logger_server

By sudhis

•Updated 3 months ago

Self-hosted remote logger for mobile apps. Live browser tail, per-device tokens, 2.5 MB image.

Image
Developer tools
0

608

sudhis/logger_server repository overview

⁠logger_server

Remote log sink for mobile app developers. Your app ships logs to a server you control; you watch them stream live in a browser. Self-hosted, one static binary, ~15 MB of RAM.

Source: https://github.com/sudhi001/logger_server⁠ Demo: https://logger-server-z5w8.onrender.com⁠

⁠Quick start

docker run -d --name logger -p 8080:8080 \
  -e LOGGER_ADMIN_TOKEN=pick-a-long-random-string \
  -v logger-data:/data \
  sudhis/logger_server:3.2.1

Open http://localhost:8080⁠, sign in with that token, go to Devices, and create one. Copy the token it shows you - it is displayed once - then:

curl -X POST http://localhost:8080/api/v1/logs \
  -H "Authorization: Bearer <device-token>" \
  -H 'content-type: application/json' \
  -d '{"name":"[MyApp] ","message":"hello","level":2}'

The line appears in your browser immediately.

The volume at /data is what makes logs survive a restart. Without it the database lives inside the container and disappears with it.

⁠What you get

  • Per-device tokens - every build or tester gets its own credential, so you can tell whose logs you are reading and revoke one without touching the rest. Tokens are stored only as a SHA-256 hash; revocation takes effect on the next request.
  • A login on reads - the dashboard and every read endpoint need a credential, so your stack traces are not world-readable.
  • A live tail worth using - search, level and device filters, pause, follow, and expandable rows that pretty-print JSON and preserve stack traces.
  • Small - 2.5 MB compressed, 11 MB idle RSS, ~25 ms cold start. A free-tier box is plenty.

⁠Also in here

  • Full-text search across your whole history, not just what is on screen.
  • Webhook alerting — Slack, Discord, PagerDuty or any endpoint, with a threshold and cooldown so a crash loop sends one message rather than a thousand.
  • An MCP endpoint so an AI assistant can search and analyse your logs directly: https://github.com/sudhi001/logger_server/blob/main/docs/agents.md⁠

⁠Tags

TagBaseSizeIdle RSS
3.2.1, latestscratch, static musl, linux/amd645.0 MB compressed15.1 MB

No OS, no shell, no package manager - nothing in the image to patch. The trade-off is that you cannot docker exec into it; build Dockerfile.glibc from the repo if you need a debuggable variant.

1.0.x-SNAPSHOT are the old Spring Boot / JVM builds (271 MB, ~300 MB RSS). They are kept only so existing deployments do not break. Use 3.2.1.

⁠Other ways to install

brew install sudhi001/tap/logger-server   # macOS, no Docker needed
cargo install logger_server               # anywhere with a Rust toolchain

⁠Configuration

Every variable has a working default. The ones that matter:

VariableDefaultWhat it does
LOGGER_ADMIN_TOKENgeneratedGates the dashboard and all reads. Set this. If you don't, one is generated at boot and printed to the log - usable, but it changes on every restart
PORT / LOGGER_PORT8080Listen port. PORT is what most PaaS platforms inject
LOGGER_DB_PATH/data/logs.dbSQLite file
LOGGER_TRUST_PROXYfalseHonour X-Forwarded-For. Turn on only behind a proxy that overwrites it
LOGGER_COOKIE_SECUREfollows TRUST_PROXYSend the session cookie with Secure. Must be off for plain-HTTP local use, or login silently fails
LOGGER_MAX_ROWS1000000Rows kept before the oldest are pruned
LOGGER_MAX_AGE_DAYS7Age cap before pruning
LOGGER_RATE_LIMIT_RPS500Per-IP writes per second. 0 disables

Full list: https://github.com/sudhi001/logger_server/blob/main/docs/configuration.md⁠

⁠Compose

services:
  logger:
    image: sudhis/logger_server:3.2.1
    restart: unless-stopped
    ports: ["8080:8080"]
    volumes: ["logger-data:/data"]
    environment:
      LOGGER_ADMIN_TOKEN: ${LOGGER_ADMIN_TOKEN:?set this}
      LOGGER_TRUST_PROXY: "true"

volumes:
  logger-data:

⁠Connect your app

Ready-to-paste loggers - buffered and batched, so you are not making one HTTP request per log line - for Kotlin, Swift, Dart, React Native, Node, Python, Go, PHP, C and C++:

https://github.com/sudhi001/logger_server/blob/main/docs/clients.md⁠

⁠Health and metrics

  • GET /healthz - public, 200 ok, or 503 draining during shutdown. Point your platform health check here.
  • GET /metrics - Prometheus text, behind the admin credential.

⁠Upgrading from 1.0.x

This is a breaking change. Writes now need a device token and reads need a login. Endpoint paths are unchanged; they simply require authentication. LOGGER_API_KEY has been removed in favour of per-device tokens.

Your database is migrated in place on first start - nothing is deleted.

https://github.com/sudhi001/logger_server/blob/main/docs/migration.md⁠

⁠Licence

MIT.

Tag summary

Content type

Image

Digest

sha256:99854d551…

Size

2.6 MB

Last updated

3 months ago

docker pull sudhis/logger_server