Skip to content

Commit 7545177

Browse files
macfarlajflo
authored andcommitted
log bootnodes and static nodes list at debug level (besu-eth#6273)
* log bootnodes and static nodes list at debug level Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> * log if zero bootnodes Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> * null safeguards Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> --------- Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com> Signed-off-by: jflo <justin+github@florentine.us>
1 parent 6c4f2de commit 7545177

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,8 +2120,6 @@ private void configure() throws Exception {
21202120
instantiateSignatureAlgorithmFactory();
21212121

21222122
logger.info(generateConfigurationOverview());
2123-
logger.info("Connecting to {} static nodes.", staticNodes.size());
2124-
logger.trace("Static Nodes = {}", staticNodes);
21252123
logger.info("Security Module: {}", securityModuleName);
21262124
}
21272125

@@ -3119,9 +3117,14 @@ private EthNetworkConfig updateNetworkConfig(final NetworkName network) {
31193117
if (listBootNodes != null) {
31203118
if (!p2PDiscoveryOptionGroup.peerDiscoveryEnabled) {
31213119
logger.warn("Discovery disabled: bootnodes will be ignored.");
3120+
} else {
3121+
logger.info("Configured {} bootnodes.", listBootNodes.size());
3122+
logger.debug("Bootnodes = {}", listBootNodes);
31223123
}
31233124
DiscoveryConfiguration.assertValidBootnodes(listBootNodes);
31243125
builder.setBootNodes(listBootNodes);
3126+
} else {
3127+
logger.info("0 Bootnodes configured");
31253128
}
31263129
return builder.build();
31273130
}
@@ -3224,7 +3227,11 @@ private Set<EnodeURL> loadStaticNodes() throws IOException {
32243227
staticNodesPath = dataDir().resolve(staticNodesFilename);
32253228
}
32263229
logger.debug("Static Nodes file: {}", staticNodesPath);
3227-
return StaticNodesParser.fromPath(staticNodesPath, getEnodeDnsConfiguration());
3230+
final Set<EnodeURL> staticNodes =
3231+
StaticNodesParser.fromPath(staticNodesPath, getEnodeDnsConfiguration());
3232+
logger.info("Connecting to {} static nodes.", staticNodes.size());
3233+
logger.debug("Static Nodes = {}", staticNodes);
3234+
return staticNodes;
32283235
}
32293236

32303237
private List<EnodeURL> buildEnodes(

0 commit comments

Comments
 (0)