Introduction
Vestig is a lightweight, zero-dependency structured logging library designed for modern JavaScript runtimes.
Leave a trace.
Why Vestig?
Most logging libraries are either too simple (just console.log wrappers) or too complex (requiring extensive configuration). Vestig strikes the perfect balance:
- Zero dependencies — No external packages, minimal bundle size
- Universal runtime support — Node.js, Bun, Deno, Edge, and Browser
- First-class Next.js support — Dedicated
@vestig/nextpackage with full App Router support - Production-ready — Structured JSON output, log levels, and timestamps
- Security-first — Automatic PII sanitization with GDPR, HIPAA, and PCI-DSS presets
- Native tracing — Built-in span support with W3C Trace Context compatibility
- Smart sampling — Probability, rate-limit, and namespace-based sampling
Features at a Glance
| Feature | Description |
|---|---|
| Structured Logging | JSON output with timestamps, levels, metadata, and context |
| PII Sanitization | Auto-redact passwords, emails, tokens, credit cards with compliance presets |
| Tracing & Spans | Native span support for tracking operations and their relationships |
| Context Propagation | Request tracing with correlation IDs via AsyncLocalStorage |
| Multiple Transports | Console, HTTP, File, and Datadog transports out of the box |
| Sampling | Control log volume with probability, rate-limit, or namespace-based sampling |
| Child Loggers | Namespaced loggers with inherited configuration |
| Multi-Runtime | Node.js, Bun, Deno, Edge, and Browser support |
| TypeScript | Full type safety and inference |
Packages
| Package | Description |
|---|---|
vestig | Core logging library with all features |
@vestig/next | First-class Next.js 15+ integration |
@vestig/express | Express.js middleware and utilities |
Quick Example
typescript
Next.js Example
typescript
Next Steps
- Installation — Get Vestig installed in your project
- Core Concepts — Learn the fundamentals
- Next.js Integration — Set up
@vestig/next - API Reference — Complete API documentation