@@ -298,9 +298,9 @@ impl NodeBuilder {
298298 self
299299 }
300300
301- /// Sets the log dir path if logs need to live separate from the storage directory path.
302- pub fn set_log_dir_path ( & mut self , log_dir_path : String ) -> & mut Self {
303- self . config . log_dir_path = Some ( log_dir_path) ;
301+ /// Sets the log file path if the log file needs to live separate from the storage directory path.
302+ pub fn set_log_file_path ( & mut self , log_dir_path : String ) -> & mut Self {
303+ self . config . log_file_path = Some ( log_dir_path) ;
304304 self
305305 }
306306
@@ -611,8 +611,8 @@ impl ArcedNodeBuilder {
611611 }
612612
613613 /// Sets the log dir path if logs need to live separate from the storage directory path.
614- pub fn set_log_dir_path ( & self , log_dir_path : String ) {
615- self . inner . write ( ) . unwrap ( ) . set_log_dir_path ( log_dir_path ) ;
614+ pub fn set_log_file_path ( & self , log_file_path : String ) {
615+ self . inner . write ( ) . unwrap ( ) . set_log_file_path ( log_file_path ) ;
616616 }
617617
618618 /// Sets the Bitcoin network used.
@@ -1234,13 +1234,13 @@ fn build_with_store_internal(
12341234/// Sets up the node logger, creating a new log file if it does not exist, or utilizing
12351235/// the existing log file.
12361236fn setup_logger ( config : & Config ) -> Result < Arc < FilesystemLogger > , BuildError > {
1237- let log_dir = match & config. log_dir_path {
1237+ let log_file_path = match & config. log_file_path {
12381238 Some ( log_dir) => String :: from ( log_dir) ,
1239- None => config. storage_dir_path . clone ( ) ,
1239+ None => format ! ( "{}/{}" , config. storage_dir_path. clone( ) , "ldk_node.log" ) ,
12401240 } ;
12411241
12421242 Ok ( Arc :: new (
1243- FilesystemLogger :: new ( log_dir , config. log_level )
1243+ FilesystemLogger :: new ( log_file_path , config. log_level )
12441244 . map_err ( |_| BuildError :: LoggerSetupFailed ) ?,
12451245 ) )
12461246}
0 commit comments