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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
path |
string |
options? |
FileFallbackOptions |
Returns
Section titled “Returns”Example
Section titled “Example”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"),});