Skip to content

Commit 47dfc26

Browse files
author
Guillaume Arnaud
committed
add topic in debug logs when lookup fails
1 parent 4849b02 commit 47dfc26

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/github/brainlag/nsq/lookup/DefaultNSQLookup.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.net.URL;
1212
import java.net.URLEncoder;
1313
import java.util.Set;
14+
1415
public class DefaultNSQLookup implements NSQLookup {
1516
Set<String> addresses = Sets.newHashSet();
1617

@@ -40,12 +41,12 @@ public Set<ServerAddress> lookup(String topic) {
4041
addresses.add(address);
4142
}
4243
} catch (IOException e) {
43-
LogManager.getLogger(this).warn("Unable to connect to address {}", addr);
44+
LogManager.getLogger(this).warn("Unable to connect to address {} for topic {}", addr, topic);
4445
LogManager.getLogger(this).debug(e.getMessage());
4546
}
4647
}
4748
if (addresses.isEmpty()) {
48-
LogManager.getLogger(this).warn("Unable to connect to any NSQ Lookup servers, servers tried: " + this.addresses.toString());
49+
LogManager.getLogger(this).warn("Unable to connect to any NSQ Lookup servers, servers tried: {} on topic: {}", this.addresses, topic);
4950
}
5051
return addresses;
5152
}

0 commit comments

Comments
 (0)