Skip to content

fileFallback

function fileFallback(path, options?): RecorderFallback;

Defined in: src/sinks/file.ts:98

A RecorderFallback that appends batches the recorder could not persist to a JSONL file.

Parameter Type
path string
options? FileFallbackOptions

RecorderFallback

import { createRecorder } from "@xtandard/audit";
import { fileFallback } from "@xtandard/audit/sinks/file";
const recorder = createRecorder(audit, {
fallback: fileFallback("/var/lib/app/audit-fallback.jsonl"),
onError: (err, batch) => logger.error({ err, parked: batch.length }, "audit storage down"),
});