Skip to content

CipherLogger — See every request. Capture every error.

CipherLogger is a lightweight, production-ready HTTP request logging library for Node.js. It captures every request in your app and gives you fine-grained control over exactly which fields end up in each log line.

npm install cipher-logger
  • TypeScript-first — full type coverage across the entire public API

  • Configurable fields — required fields are always recorded, optional fields are opt-in

  • Framework adapters — Express and Next.js today, Fastify/Hono/NestJS/Nuxt on the way

  • Zero heavy dependencies — only your framework as an optional peer dependency

  • Node.js 18+ — modern runtime, ESM & CJS output


Quick Example

import express from "express";
import { createCipherLogger } from "cipher-logger";

const app = express();

const cipher = createCipherLogger({
  fields: { ip: true, userAgent: true, query: true },
  level: "info",
  prefix: "api",
});

app.use(cipher.express());

app.get("/users", (req, res) => res.json({ users: [] }));

app.listen(3000);
[2026-09-01T20:00:00.000Z] [INFO] [api] HTTP Request {
  id: 'a1b2c3d4-...',
  type: 'http',
  timestamp: '2026-09-01T20:00:00.000Z',
  method: 'GET',
  path: '/users?page=1',
  status: 200,
  duration: 12,
  ip: '::1',
  userAgent: 'Mozilla/5.0 ...',
  query: { page: '1' }
}

Ready for more? Follow the Quick Start guide.


Why CipherLogger?

Ad-hoc console.log Generic loggers (pino, morgan) CipherLogger
Schema None — every call differs Format-defined, not HTTP-aware Fixed RequestLog shape, HTTP-first
Field control Manual, per call Global formatter Per-field opt-in (fields config)
Framework wiring Manual Separate middleware packages Built-in express() / next() adapters
TypeScript N/A Varies Fully typed, exported types for every shape
Accurate timing Manual Manual Built-in, per-adapter (see caveats)

Get Started


Copyright © 2026 Cipher-Unit · Made with Zensical