2 unstable releases

0.2.0 Jan 14, 2023
0.1.0 Mar 31, 2021

#260 in Debugging

Download history 31496/week @ 2024-11-21 31949/week @ 2024-11-28 38287/week @ 2024-12-05 29058/week @ 2024-12-12 19858/week @ 2024-12-19 14126/week @ 2024-12-26 30302/week @ 2025-01-02 33303/week @ 2025-01-09 31410/week @ 2025-01-16 33285/week @ 2025-01-23 34269/week @ 2025-01-30 37544/week @ 2025-02-06 28533/week @ 2025-02-13 25122/week @ 2025-02-20 33198/week @ 2025-02-27 35163/week @ 2025-03-06

128,868 downloads per month
Used in 38 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