Struct log4rs_rolling_file::roll::fixed_window::FixedWindowRoller
[−]
[src]
pub struct FixedWindowRoller {
// some fields omitted
}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 achived 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.
Methods
impl FixedWindowRoller
fn builder() -> FixedWindowRollerBuilder
Constructs a new FixedWindowRollerBuilder.