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

Returns a new builder for the FixedWindowRoller.

Trait Implementations

Formats the value using the given formatter. Read more

Processes the log file. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.