Lightweight & ESM-only logger for NodeJS
  • TypeScript 99.6%
  • JavaScript 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Andrés Correa Casablanca deb4788d0d
chhore: upgrade deps
Signed-off-by: Andres Correa Casablanca <andreu@ctrlback.coop>
2026-09-30 10:32:52 +02:00
.hooks fix(logtau-worker): run the worker loop without a top-level await 2026-06-24 12:49:18 +02:00
packages chhore: upgrade deps 2026-09-30 10:32:52 +02:00
.gitignore test(bench-vs-pino): off-thread transport comparison 2026-06-24 16:23:24 +02:00
.prototools chhore: upgrade deps 2026-09-30 10:32:52 +02:00
LICENSE.md chore: package publishable metadata + MIT license 2026-05-30 00:09:11 +02:00
package.json chhore: upgrade deps 2026-09-30 10:32:52 +02:00
pnpm-lock.yaml chhore: upgrade deps 2026-09-30 10:32:52 +02:00
pnpm-workspace.yaml feat(logtau-astro): astro logger adapter 2026-08-16 22:34:56 +02:00
README.md docs(logtau-astro): document usage 2026-08-16 23:55:54 +02:00

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-astro Route Astro logs through logtau.
@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/.

License

Created by CTRLback.

Distributed under MIT License.