LeviLamina
Loading...
Searching...
No Matches
ll::io::RotateConfig Struct Reference

#include <RotatePolicy.h>

Inheritance diagram for ll::io::RotateConfig:

Public Attributes

bool rotateOnOpen = true
uint64 maxFileSize = 32ull * 1024 * 1024
RotateInterval interval = RotateInterval::Daily
bool compress = true
 Compresses archives to gzip on a background thread. The active file is never compressed.
size_t keepUncompressed = 7
bool cleanup = true
 Deletes archives that fall outside the limits below. When false, nothing is ever removed.
size_t maxFiles = 1024
 Keeps at most this many archives, counting compressed and plain alike. 0 disables the limit.
int maxAgeDays = 120
 Removes archives last modified more than this many days ago. 0 disables the limit.
uint64 totalSizeCap = 512ull * 1024 * 1024

Detailed Description

The subset of a RotatePolicy that is plain data, so it can be reflected into a config file.

Note
Kept separate from RotatePolicy because the latter carries a std::function, which the reflection based serializer cannot handle.

Member Data Documentation

◆ rotateOnOpen

bool ll::io::RotateConfig::rotateOnOpen = true

Archives an existing, non-empty file when the sink opens it, so each run owns its own file instead of appending to the previous run's output.

◆ maxFileSize

uint64 ll::io::RotateConfig::maxFileSize = 32ull * 1024 * 1024

Rotates once writing the next message would grow the file past this many bytes. 0 disables the size trigger.

Note
A single message is never split across files, so one oversized message produces one oversized file.

◆ interval

RotateInterval ll::io::RotateConfig::interval = RotateInterval::Daily

Rotates when the message's timestamp crosses this boundary. Evaluated against the time the message was created rather than the time it reaches the file.

◆ keepUncompressed

size_t ll::io::RotateConfig::keepUncompressed = 7

Leaves this many of the newest archives uncompressed, so recently rotated output stays greppable without unpacking it first.

◆ totalSizeCap

uint64 ll::io::RotateConfig::totalSizeCap = 512ull * 1024 * 1024

Removes the oldest archives until their total size on disk falls below this. 0 disables the limit.

Note
This counts compressed sizes, so the reachable history depends on compress.

The documentation for this struct was generated from the following file: