2 unstable releases

0.2.0 Jan 14, 2023
0.1.0 Mar 31, 2021

#229 in Debugging

Download history 27711/week @ 2024-07-20 26464/week @ 2024-07-27 31278/week @ 2024-08-03 26203/week @ 2024-08-10 25469/week @ 2024-08-17 28623/week @ 2024-08-24 24268/week @ 2024-08-31 24271/week @ 2024-09-07 16990/week @ 2024-09-14 23463/week @ 2024-09-21 23093/week @ 2024-09-28 28009/week @ 2024-10-05 31572/week @ 2024-10-12 34826/week @ 2024-10-19 33030/week @ 2024-10-26 34001/week @ 2024-11-02

137,803 downloads per month
Used in 37 crates (5 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