#rotation #log-file #numbers #max #file-rotation

simple-file-rotation

A very simple file rotator

7 releases

0.3.4 Aug 17, 2022
0.3.3 May 5, 2022
0.2.1 May 3, 2022
0.1.0 May 3, 2022

#17 in #max

Download history 157/week @ 2024-07-26 82/week @ 2024-08-02 111/week @ 2024-08-09 112/week @ 2024-08-16 169/week @ 2024-08-23 100/week @ 2024-08-30 101/week @ 2024-09-06 122/week @ 2024-09-13 156/week @ 2024-09-20 324/week @ 2024-09-27 189/week @ 2024-10-04 149/week @ 2024-10-11 190/week @ 2024-10-18 184/week @ 2024-10-25 86/week @ 2024-11-01 83/week @ 2024-11-08

570 downloads per month
Used in 2 crates

Custom license

8KB
130 lines

simple-file-rotation

This is an implementation of simple FileRotation mechanism using only std. Given a file like my.log, it will copy that file to my.1.log, renaming a potentially pre-existing my.1.log to my.2.log. It accepts an optional number of max filesto keep. It will only rotate files when invoked, it will /not/ watch any files or do any kind of background processing.

use simple_file_rotation::{FileRotation};
FileRotation::new("my.log")
    .max_old_files(2)
    .rotate()?;

Why yet another file rotation library?

  • No additional dependencies.
  • No features I don't need.

lib.rs:

This is an implementation of simple FileRotation mechanism using only std. Given a file like my.log, it will copy that file to my.1.log, renaming a potentially pre-existing my.1.log to my.2.log. It accepts an optional number of max filesto keep. It will only rotate files when invoked, it will /not/ watch any files or do any kind of background processing.

use simple_file_rotation::{FileRotation};
FileRotation::new("my.log")
    .max_old_files(2)
    .rotate()?;

Why yet another file rotation library?

  • No additional dependencies.
  • No features I don't need.

No runtime deps