Struct log4rs::append::rolling_file::policy::compound::roll::fixed_window::FixedWindowRoller
source · [−]pub struct FixedWindowRoller { /* private fields */ }
Expand description
A roller which maintains a fixed window of archived log files.
A FixedWindowRoller
is configured with a filename pattern, a base index,
and a maximum file count. Each archived log file is associated with a numeric
index ordering it by age, starting at the base index. Archived log files are
named by substituting all instances of {}
with the file’s index in the
filename pattern.
For example, if the filename pattern is archive/foo.{}.log
, the base index
is 0 and the count is 2, the first log file will be archived as
archive/foo.0.log
. When the next log file is archived, archive/foo.0.log
will be renamed to archive/foo.1.log
and the new log file will be named
archive/foo.0.log
. When the third log file is archived,
archive/foo.1.log
will be deleted, archive/foo.0.log
will be renamed to
archive/foo.1.log
, and the new log file will be renamed to
archive/foo.0.log
.
If the file extension of the pattern is .gz
and the gzip
Cargo feature
is enabled, the archive files will be gzip-compressed.
Note that this roller will have to rename every archived file every time the log rolls over. Performance may be negatively impacted by specifying a large count.
Implementations
sourceimpl FixedWindowRoller
impl FixedWindowRoller
sourcepub fn builder() -> FixedWindowRollerBuilder
pub fn builder() -> FixedWindowRollerBuilder
Returns a new builder for the FixedWindowRoller
.
Trait Implementations
sourceimpl Debug for FixedWindowRoller
impl Debug for FixedWindowRoller
Auto Trait Implementations
impl RefUnwindSafe for FixedWindowRoller
impl Send for FixedWindowRoller
impl Sync for FixedWindowRoller
impl Unpin for FixedWindowRoller
impl UnwindSafe for FixedWindowRoller
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more