Lightweight & ESM-only logger for NodeJS
- TypeScript 99.6%
- JavaScript 0.4%
|
|
||
|---|---|---|
| .hooks | ||
| packages | ||
| .gitignore | ||
| .prototools | ||
| LICENSE.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
LogTau
A fast, ESM-only, structured logger for modern Node.js. Output is NDJSON, the public API is small, the hot path is designed to do as little work as possible, and the package has zero production dependencies.
This repository is a pnpm workspace. The core library is
@ctrlback/logtau; a set of satellite packages add
context propagation, framework adapters, extra destinations and output formats.
Requirements
- Node.js
>= 22.6 - Pure ESM consumer (the packages are
"type": "module"with no CJS export)
Quick start
pnpm add @ctrlback/logtau
import { createLogger, stdoutSink } from '@ctrlback/logtau'
const log = createLogger({ level: 'info', sink: stdoutSink() })
log.info('server started', { port: 3000 })
log.warn('rate limit nearing', { remaining: 12 })
The @ctrlback/logtau guide covers bindings, the
category registry, sinks, redaction, record shaping and pluggable output
formats.
Packages
| Package | What it gives you |
|---|---|
@ctrlback/logtau |
Core structured logger: NDJSON output, category registry, redaction, pluggable formatters. |
@ctrlback/logtau-context |
Propagate ambient fields across async boundaries with AsyncLocalStorage. |
@ctrlback/logtau-hono |
Per-request child logger and access logs for Hono. |
@ctrlback/logtau-drizzle |
Route Drizzle ORM query logs through logtau. |
@ctrlback/logtau-egress |
Log destinations: files with rotation and compression, plus HTTP, TCP, TLS, and UDP network sinks (including GELF over UDP). |
@ctrlback/logtau-formats |
Extra output formatters: logfmt and GELF. |
@ctrlback/logtau-pretty |
Human-readable NDJSON, as a CLI or a Transform stream. |
@ctrlback/logtau-worker |
Move log serialization and writing to a dedicated worker thread. |
Benchmarks
A benchmark against pino lives in packages/bench-vs-pino/.