#rolling #logging #tracing #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

#204 in Debugging

Download history 12900/week @ 2023-11-21 18799/week @ 2023-11-28 18834/week @ 2023-12-05 21047/week @ 2023-12-12 19082/week @ 2023-12-19 10919/week @ 2023-12-26 20785/week @ 2024-01-02 22000/week @ 2024-01-09 24772/week @ 2024-01-16 23674/week @ 2024-01-23 20188/week @ 2024-01-30 21087/week @ 2024-02-06 17842/week @ 2024-02-13 22129/week @ 2024-02-20 22226/week @ 2024-02-27 17407/week @ 2024-03-05

82,473 downloads per month
Used in 33 crates (4 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
~18K SLoC