tracing-rolling-file

Crates.iotracing-rolling-file
lib.rstracing-rolling-file
version0.1.2
sourcesrc
created_at2022-08-16 18:51:30.266056
updated_at2023-09-26 10:21:49.833088
descriptionA rolling file appender with customizable rolling conditions.
homepagehttps://github.com/cavivie/tracing-rolling-file
repositoryhttps://github.com/cavivie/tracing-rolling-file
max_upload_size
id646875
size36,825
cavivie (cavivie)

documentation

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

README

tracing-rolling-file

tracing-rolling-file on GitHub Actions tracing-rolling-file on crates.io tracing-rolling-file on docs.rs GitHub: cavivie/tracing-rolling-file license: MIT or Apache-2.0 minimum rustc: 1.42

A rolling file appender with customizable rolling conditions, based on rolling-file. 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 tracing_rolling_file::*;
let file_appender = RollingFileAppenderBase::new(
    "/var/log/myprogram",
    RollingConditionBase::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.

Commit count: 7

cargo fmt