fix: update log file handling to include timestamp in renamed log files
This commit is contained in:
@@ -89,7 +89,9 @@ async fn catch_all(req: HttpRequest, _payload: Option<web::Json<Value>>) -> acti
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let _ = fs::create_dir_all(LOG_DIR);
|
||||
let _ = fs::remove_file(format!("{}{}", LOG_DIR, LOG_FILE_NAME));
|
||||
let log_file_path = format!("{}{}", LOG_DIR, LOG_FILE_NAME);
|
||||
let time_tag = chrono::Local::now().format("%Y_%m_%d");
|
||||
let _ = fs::rename(log_file_path, format!("{}_{}", time_tag, &LOG_FILE_NAME));
|
||||
|
||||
let assets = data_mgt::AssetTracker::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user