Expand description
The file-logger node — appends per-request access-log entries as
newline-delimited JSON to a local file, mirroring APISIX’s file-logger
plugin.
Entries are built with the shared build_entry
helper and handed to a BatchSink; a background task opens the target
file in append mode per flush and writes each entry as one JSON line.
Writing is fire-and-forget on the request path — Plugin::execute pushes
the entry and returns the context unchanged — so place this node in the
response pipeline after the upstream node.
§Deviations from APISIX
- APISIX writes each request immediately; featherbit routes writes through
the shared
BatchSinkfor consistency with the other loggers. Setbatch_max_size: 1to write every entry as it arrives. - The parent directory is not created: if it is missing the flush fails
(logged and, per
BatchConfig, retried/dropped). The file itself is created if absent.
Structs§
- File
Flusher 🔒 BatchFlusherthat appends the batch topath.- File
Logger Plugin - The
file-loggerplugin node.
Functions§
- entries_
to_ 🔒lines - Serializes each entry as one line of JSON, newline-terminated. Pure and I/O-independent for unit testing.