From f73c05420a7e48511b8252823eb0054b6d9dd746 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Sun, 31 Jul 2016 22:17:49 +0200 Subject: [PATCH] Improve logging --- .../main/java/io/bitsquare/p2p/peers/PeerManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/network/src/main/java/io/bitsquare/p2p/peers/PeerManager.java b/network/src/main/java/io/bitsquare/p2p/peers/PeerManager.java index 4ed2094a39..1b35ebb7a2 100644 --- a/network/src/main/java/io/bitsquare/p2p/peers/PeerManager.java +++ b/network/src/main/java/io/bitsquare/p2p/peers/PeerManager.java @@ -162,7 +162,9 @@ public class PeerManager implements ConnectionListener { final boolean seedNode = isSeedNode(connection); final Optional addressOptional = connection.getPeersNodeAddressOptional(); - log.info("onConnection: peer = {}{}", (addressOptional.isPresent() ? addressOptional.get().hostName : "not known yet"), seedNode ? " (SeedNode)" : ""); + log.info("onConnection: peer = {}{}", + (addressOptional.isPresent() ? addressOptional.get().hostName : "not known yet (connection id=" + connection.getUid() + ")"), + seedNode ? " (SeedNode)" : ""); if (seedNode) connection.setPeerType(Connection.PeerType.SEED_NODE); @@ -184,7 +186,10 @@ public class PeerManager implements ConnectionListener { " / closeConnectionReason: " + closeConnectionReason); final Optional addressOptional = connection.getPeersNodeAddressOptional(); - log.info("onDisconnect: peer = {}{}", (addressOptional.isPresent() ? addressOptional.get().hostName : "not known yet"), isSeedNode(connection) ? " (SeedNode)" : ""); + log.info("onDisconnect: peer = {}{} / closeConnectionReason: {}", + (addressOptional.isPresent() ? addressOptional.get().hostName : "not known yet (connection id=" + connection.getUid() + ")"), + isSeedNode(connection) ? " (SeedNode)" : "", + closeConnectionReason); handleConnectionFault(connection);