Enum StoragePolicy
pub enum StoragePolicy {
None,
Rolling,
Full,
Rotating,
}Expand description
JSONL persistence policy.
Variants§
None
Do not persist; in-process broadcast only.
Rolling
Persist with rolling trim once max_entries is exceeded.
Full
Persist all events forever (operator manages rotation).
Rotating
Persist all events, rotating the active file to timestamped archives on a size and/or daily boundary and pruning old archives by count and age.
Implementations§
Source§impl StoragePolicy
impl StoragePolicy
pub fn from_raw(raw: &str) -> Self
pub fn is_enabled(self) -> bool
Sourcepub fn reads_archives(self) -> bool
pub fn reads_archives(self) -> bool
Whether a reader should merge timestamped archives with the active file.
Only Rotating owns archives: it creates them and prunes them under
retention_max_files / retention_max_age_days. Every other policy
reads the active file alone. That matters most for Rolling, whose
contract is “the most recent max_entries events, older ones
discarded”: if a path previously ran Rotating, its archives are still
on disk but explicitly unmanaged (see the storage-policy table in
docs/book/src/architecture/logging.md). Merging them would resurrect
events the rolling window is supposed to have dropped, and they would
never be pruned, since no rotation runs to trigger retention.
Trait Implementations§
Source§impl Clone for StoragePolicy
impl Clone for StoragePolicy
Source§fn clone(&self) -> StoragePolicy
fn clone(&self) -> StoragePolicy
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more