#rolling #logging #tracing

rolling-file

A rolling file appender with customizable rolling conditions

2 unstable releases

0.2.0 Jan 14, 2023
0.1.0 Mar 31, 2021

#165 in Debugging

Download history 1940/week @ 2023-05-29 2302/week @ 2023-06-05 2940/week @ 2023-06-12 2520/week @ 2023-06-19 3742/week @ 2023-06-26 3271/week @ 2023-07-03 3670/week @ 2023-07-10 2973/week @ 2023-07-17 3427/week @ 2023-07-24 3963/week @ 2023-07-31 3955/week @ 2023-08-07 7392/week @ 2023-08-14 9443/week @ 2023-08-21 10947/week @ 2023-08-28 9880/week @ 2023-09-04 8616/week @ 2023-09-11

39,341 downloads per month
Used in 19 crates (3 directly)

MIT/Apache

28KB
507 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.

Changelog

See CHANGELOG.md

Dependencies

~1MB
~17K SLoC