Open source · vishwajit-vm Designed · Phase 1
Strutvane Logs
Zero-config logging with a built-in log viewer
@strutvane/logs gives any Node app structured, non-blocking logs with zero configuration: automatic request and error logging, daily files with size caps and retention, secret redaction before anything is stored, and a built-in viewer at /_strutvane/logs with live tail, search and download. It is installed by default in Strutvane apps and also works in Express, Fastify, Hono and NestJS.
Built for: Any Node.js app — Express, Fastify, Hono or NestJS — and every Strutvane app by default.
Packages on npm
@strutvane/logs↗Name reserved · planned for 0.1 alpha
↓ Scroll to explore the problem, architecture and stack
The problem
Good logging takes a day of setup — transports, rotation, retention, redaction, a way to read logs — and logs often leak secrets or slow requests down.
Why it matters
Making safe, fast logging the default means every app starts with searchable logs and no leaked tokens — and the logger is designed to never crash the app it is watching.
What you can do with it
How it’s built
A simplified view of the architecture — follow the dots as a request moves down the layers.
A request, step by step
- Your code logs a record; the current request context is attached automatically.
- Sensitive keys and five secret patterns are redacted before anything is serialized.
- The record becomes one line (max 32 KB) and joins a bounded priority queue.
- A writer flushes batches with appends, one file per process, rotating daily within size caps.
- The viewer merges every process’s files by timestamp for live tail and search.
Tech stack
What I built
- Designed the logging pipeline and viewer (RFC-0004).
- Benchmarked it in spike 09 (44 tests plus a Linux-only test, 4 planted bugs caught): 1.3–4× faster than pino when writing files, adding only 2.9 ms at p99 under HTTP load.
- Replaced a shared log file — which broke size rotation across processes in 24 of 28 files — with one file per process, merged by timestamp in the viewer (ADR-0015).
- Fixed a shutdown bug that lost the exit code, using a flush deadline timer, and kept memory bounded by dropping low-severity records first and reporting the drop count.
Hard problems & how I solved them
✅ Each process writes its own file and the viewer merges them by timestamp (ADR-0015).
✅ A bounded queue drops low-severity records first and reports the drop count; a flush deadline keeps exit codes intact.