pub enum Rotation {
SizeBased(RotationSize),
AgeBased(RotationAge),
}Expand description
Defines the strategy for when log files should be rotated.
LogRoller supports two main rotation strategies:
- Size-based: Rotate when a file reaches a certain size
- Age-based: Rotate at fixed time intervals
Each strategy has different benefits and use cases:
- Size-based is good for controlling disk space usage
- Age-based is better for time-based organization and retention
Variants§
SizeBased(RotationSize)
Rotate log files when they reach a specified size. The rotated files are numbered sequentially (e.g., log.1, log.2). This helps prevent individual log files from becoming too large and ensures consistent file sizes.
AgeBased(RotationAge)
Rotate log files based on time intervals. Files are named with timestamps according to the specified interval. This creates a clear chronological organization of log files and makes it easy to locate logs from specific time periods.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rotation
impl RefUnwindSafe for Rotation
impl Send for Rotation
impl Sync for Rotation
impl Unpin for Rotation
impl UnwindSafe for Rotation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more