Struct log4rs_rolling_file::policy::compound::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
[src]

fn builder() -> FixedWindowRollerBuilder

Constructs a new FixedWindowRollerBuilder.

Trait Implementations

impl Roll for FixedWindowRoller
[src]

fn roll(&self, file: &Path) -> Result<(), Box<Error>>

Processes the log file. Read more

Derived Implementations

impl Debug for FixedWindowRoller
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.