Skip to content

Commit 71ff89c

Browse files
committed
Add the date when the node was started to the name of the logfile. This makes it easier to delete old logs
1 parent 427e74c commit 71ff89c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,11 @@ impl Builder {
384384
fs::create_dir_all(bdk_data_dir.clone()).expect("Failed to create BDK data directory");
385385

386386
// Initialize the Logger
387-
let log_file_path = format!("{}/ldk_node.log", config.storage_dir_path);
387+
let log_file_path = format!(
388+
"{}/logs/ldk_node_{}.log",
389+
config.storage_dir_path,
390+
chrono::offset::Local::now().format("%Y_%m_%d")
391+
);
388392
let logger = Arc::new(FilesystemLogger::new(log_file_path, config.log_level));
389393

390394
// Initialize the on-chain wallet and chain access

0 commit comments

Comments
 (0)