File Logging
Blyp writes structured NDJSON logs to disk and rotates them automatically.
Active files
logs/log.ndjson: active combined streamlogs/log.error.ndjson: active error and critical streamlogs/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 MBmax active file size5retained 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,
});Related exports
import type { LogRecord, ReadLogFileOptions } from "blyp-js";Use LogRecord when you want to type the parsed NDJSON entries in your own tooling.