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§
source§impl FixedWindowRoller
impl FixedWindowRoller
sourcepub fn builder() -> FixedWindowRollerBuilder
pub fn builder() -> FixedWindowRollerBuilder
Returns a new builder for the FixedWindowRoller
.
Trait Implementations§
source§impl Clone for FixedWindowRoller
impl Clone for FixedWindowRoller
source§fn clone(&self) -> FixedWindowRoller
fn clone(&self) -> FixedWindowRoller
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more