#rolling #logging #tracing

rolling-file

A rolling file appender with customizable rolling conditions

1 unstable release

0.1.0 Mar 31, 2021

#257 in Debugging

Download history 784/week @ 2022-06-05 1030/week @ 2022-06-12 642/week @ 2022-06-19 780/week @ 2022-06-26 704/week @ 2022-07-03 1004/week @ 2022-07-10 1002/week @ 2022-07-17 1289/week @ 2022-07-24 1483/week @ 2022-07-31 1113/week @ 2022-08-07 1431/week @ 2022-08-14 1168/week @ 2022-08-21 1554/week @ 2022-08-28 1368/week @ 2022-09-04 1287/week @ 2022-09-11 1313/week @ 2022-09-18

5,555 downloads per month

MIT/Apache

22KB
391 lines

rolling-file

rolling-file on GitHub Actions rolling-file on crates.io rolling-file on docs.rs GitHub: Axcient/rolling-file-rs license: MIT or Apache-2.0 minimum rustc: 1.42

A rolling file appender with customizable rolling conditions. Includes built-in support for rolling conditions on date/time (daily, hourly, every minute) and/or size.

Follows a Debian-style naming convention for logfiles, using basename, basename.1, ..., basename.N where N is the maximum number of allowed historical logfiles.

This is useful to combine with the tracing crate and tracing_appender::non_blocking::NonBlocking -- use it as an alternative to tracing_appender::rolling::RollingFileAppender.

Examples

use rolling_file::*;
let file_appender = BasicRollingFileAppender::new(
    "/var/log/myprogram",
    RollingConditionBasic::new().daily(),
    9
).unwrap();

Development

Must pass latest stable clippy, be formatted with nightly rustfmt, and pass unit tests:

cargo +nightly fmt
cargo clippy --all-targets
cargo test

License

Dual-licensed under the terms of either the MIT license or the Apache 2.0 license.

Dependencies

~1MB
~15K SLoC