Log Rotation (bundled plugin, off by default)
このコンテンツはまだ日本語訳がありません。
Every intervalMs the state-root log directory (and every directory in dirs) is scanned:
- a live log (
*.logby default) larger thanmaxBytesis rotated to<name>.1; older generations shift to.2,.3, … and at mostkeepare kept (keep: 0truncates in place); - rotated generations older than
maxAgeDaysare deleted; - with
compress: truethe new.1is gzip-compressed in process (zlib), never by a shell.
Live logs are never deleted, only rotated. A run that changed anything is audited as
log.rotated (or log.rotate_dry_run) with the file lists; the last run is published as the
log_rotation.lastRun signal.
Config
Section titled “Config”{ plugins: { entries: { "log-rotation": { enabled: true, config: { intervalMs: 600000, // >= 10000 maxBytes: 52428800, // 50 MB maxAgeDays: 14, keep: 3, compress: false, dirs: ["~/.kolo-sibling/logs"], // extra directories; the state-root logs dir is always included extensions: [".log"], dryRun: false, // true: audit what would happen, touch nothing }, }, }, },}Enable with kurahi plugins enable log-rotation (applied live by a running gateway).
- Rotated names follow
<file>.<n>/<file>.<n>.gz; the age cap only ever touches those. - The gateway’s own log writer keeps its file handle: after a rotation it continues in the
renamed
.1until it reopens on its next day boundary. For a strict cap on the gateway’s own file, size theloggingconfig and let this plugin handle everything else. - Audit source:
plugin:log-rotation.