#rolling #logging #tracing #minutes

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

#201 in Debugging

Download history 12204/week @ 2023-12-23 17192/week @ 2023-12-30 24113/week @ 2024-01-06 22516/week @ 2024-01-13 24328/week @ 2024-01-20 20152/week @ 2024-01-27 22232/week @ 2024-02-03 16862/week @ 2024-02-10 22599/week @ 2024-02-17 22048/week @ 2024-02-24 21390/week @ 2024-03-02 22594/week @ 2024-03-09 23923/week @ 2024-03-16 21371/week @ 2024-03-23 21799/week @ 2024-03-30 21803/week @ 2024-04-06

92,185 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