Crates.io | rolling-file-opt |
lib.rs | rolling-file-opt |
version | 1.0.4 |
source | src |
created_at | 2024-05-20 12:16:53.448506 |
updated_at | 2024-05-20 12:41:37.015019 |
description | A rolling file appender with customizable rolling conditions. |
homepage | https://github.com/WANG-lp/rolling-file-rs |
repository | https://github.com/WANG-lp/rolling-file-rs |
max_upload_size | |
id | 1245669 |
size | 30,702 |
NOTE: this repo is based on https://github.com/Axcient/rolling-file-rs
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.
Log files structures(with log
as folder and log.log
as prefix):
(a symbol link always points to the latest one log file)
(e.g. log.log.20240520.010101)
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.
use rolling_file::*;
let file_appender = BasicRollingFileAppender::new(
"./log", // folder
"log.log", // prefix
RollingConditionBasic::new().daily(),
9
).unwrap();
Must pass latest stable clippy, be formatted with nightly rustfmt, and pass unit tests:
cargo +nightly fmt
cargo clippy --all-targets
cargo test
Dual-licensed under the terms of either the MIT license or the Apache 2.0 license.
See CHANGELOG.md