rolling-file

Crates.iorolling-file
lib.rsrolling-file
version0.2.0
sourcesrc
created_at2021-03-31 16:26:23.769886
updated_at2023-01-14 03:38:53.8607
descriptionA rolling file appender with customizable rolling conditions.
homepagehttps://github.com/Axcient/rolling-file-rs
repositoryhttps://github.com/Axcient/rolling-file-rs
max_upload_size
id376211
size41,744
Kevin Hoffman (kevinhoffman)

documentation

https://docs.rs/rolling-file/

README

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

Commit count: 16

cargo fmt