Crates.io | flexi_logger_rotate_writer |
lib.rs | flexi_logger_rotate_writer |
version | 0.0.0 |
source | src |
created_at | 2021-03-28 11:05:10.33982 |
updated_at | 2021-03-28 11:05:10.33982 |
description | A custom log writer for emabee's flexi_logger. It is just a simplified version of flexi_logger's FileLogWriter. Simply rotates every day, and stores the logs in files like `foo_r2021-03-28.log`. No cleanup. No other configs. |
homepage | https://github.com/AlephAlpha/flexi_logger_rotate_writer |
repository | https://github.com/AlephAlpha/flexi_logger_rotate_writer |
max_upload_size | |
id | 374623 |
size | 18,432 |
A custom log writer for emabee's flexi_logger.
It is just a simplified version of flexi_logger's FileLogWriter
. Simply rotates every day, and stores the logs in files like foo_r2021-03-28.log
. No cleanup. No other configs.
Most of the codes are directly taken from flexi_logger, with some modification.
use flexi_logger_rotate_writer::RotateLogWriter;
use flexi_logger::{Logger, LogTarget};
fn main() {
let log_writer = RotateLogWriter::builder()
.directory("path/to/where/you/want/to/store/the/log/files")
// Some other configs...
.try_build()?;
Logger::with_env()
.log_target(LogTarget::Writer(Box::new(log_writer)))
// Some other configs...
.start()?;
// ...
}