Log which addresses connection attempts are made against
diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx
index 684ff8b..f51873c 100644
--- a/common/network/TcpSocket.cxx
+++ b/common/network/TcpSocket.cxx
@@ -169,6 +169,7 @@
     int family;
     vnc_sockaddr_t sa;
     socklen_t salen;
+    char ntop[NI_MAXHOST];
 
     family = current->ai_family;
 
@@ -193,6 +194,9 @@
     else
       sa.u.sin6.sin6_port = htons(port);
 
+    getnameinfo(&sa.u.sa, salen, ntop, sizeof(ntop), NULL, 0, NI_NUMERICHOST);
+    vlog.debug("Connecting to %s [%s] port %d", host, ntop, port);
+
     sock = socket (family, SOCK_STREAM, 0);
     if (sock == -1) {
       err = errorNumber;
@@ -207,6 +211,8 @@
       if (err == EINTR)
         continue;
 #endif
+      vlog.debug("Failed to connect to address %s port %d: %d",
+                 ntop, port, err);
       closesocket(sock);
       sock = -1;
       break;