Change log filename to YYYY-MM-DD.log
This commit is contained in:
parent
91f1967bc5
commit
3b7fe29f0f
@ -17,7 +17,12 @@ pub fn main() {
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(PathBuf::from(DEFAULT_LOG_DIR));
|
.unwrap_or(PathBuf::from(DEFAULT_LOG_DIR));
|
||||||
let log_path = Path::new(&log_path);
|
let log_path = Path::new(&log_path);
|
||||||
let file_writer = tracing_appender::rolling::daily(log_path, "log");
|
let file_writer = tracing_appender::rolling::RollingFileAppender::builder()
|
||||||
|
.rotation(tracing_appender::rolling::Rotation::DAILY)
|
||||||
|
.filename_suffix("log")
|
||||||
|
.build(log_path)
|
||||||
|
.expect("could not create file writer");
|
||||||
|
// let file_writer = tracing_appender::rolling::daily(log_path, "log");
|
||||||
let (file_writer, _guard) = tracing_appender::non_blocking(file_writer);
|
let (file_writer, _guard) = tracing_appender::non_blocking(file_writer);
|
||||||
|
|
||||||
tracing_subscriber::registry()
|
tracing_subscriber::registry()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user