fix log dir not work; fix stun config from file not work; (#1393)

This commit is contained in:
Sijie.Sun
2025-09-20 00:20:08 +08:00
committed by GitHub
parent 1a1be8138a
commit c9e8c35e77
2 changed files with 17 additions and 3 deletions
+6 -1
View File
@@ -81,9 +81,14 @@ pub fn init_logger(
});
}
let dir = file_config.dir.as_deref().unwrap_or(".");
let file = file_config.file.as_deref().unwrap_or("easytier.log");
let path = std::path::Path::new(dir).join(file);
let path_str = path.to_string_lossy().into_owned();
let builder = RollingFileAppenderBase::builder();
let file_appender = builder
.filename(file_config.file.unwrap_or("easytier.log".to_string()))
.filename(path_str)
.condition_daily()
.max_filecount(file_config.count.unwrap_or(10))
.condition_max_file_size(file_config.size_mb.unwrap_or(100) * 1024 * 1024)