Blyp Docs

File Logging

Blyp writes structured NDJSON logs to disk and rotates them automatically.

Active files

  • logs/log.ndjson: active combined stream
  • logs/log.error.ndjson: active error and critical stream
  • logs/archive/*.ndjson.gz: rotated archives

Client-ingested browser logs are written into the same combined stream, with the original payload stored under data.

Defaults

  • rotation enabled
  • 10 MB max active file size
  • 5 retained archives per stream
  • gzip-compressed archives

Configure rotation

import { createStandaloneLogger } from "blyp-js";

const logger = createStandaloneLogger({
  pretty: true,
  file: {
    rotation: {
      maxSizeBytes: 5 * 1024 * 1024,
      maxArchives: 3,
      compress: true,
    },
  },
});

Read stored logs

import { readLogFile } from "blyp-js";

const pretty = await readLogFile("logs/log.ndjson");

const records = await readLogFile("logs/archive/log.20260309T101530Z.ndjson.gz", {
  format: "json",
  limit: 100,
});
import type { LogRecord, ReadLogFileOptions } from "blyp-js";

Use LogRecord when you want to type the parsed NDJSON entries in your own tooling.

On this page

No Headings