Skip to content
Permalink
Browse files

Improve logging

  • Loading branch information
ibauersachs committed Nov 8, 2019
1 parent 2f95fb7 commit 9225d353d1720c3ab85cda0dc1444f1e247ab08b
@@ -205,7 +205,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.28</version>
<version>1.7.29</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -249,6 +249,12 @@
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.29</version>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
@@ -721,8 +721,9 @@ public SetResponse addMessage(Message in) {
cred = getCred(Section.ADDITIONAL, isAuth);
addRRset(rRset, cred);
}
log.debug("addMessage: {}", response);
return (response);

log.debug("caching {} for {}", response, in.getQuestion().getName());
return response;
}

/**
@@ -428,4 +428,9 @@ public void setLoadBalance(boolean flag) {
public void setRetries(int retries) {
this.retries = retries;
}

@Override
public String toString() {
return "ExtendedResolver of " + resolvers;
}
}
@@ -433,10 +433,8 @@ private void processResponse(Name name, SetResponse response) {

private void lookup(Name current) {
SetResponse sr = cache.lookupRecords(current, type, credibility);
if (log.isDebugEnabled()) {
log.debug("lookup {} {}", current, Type.string(type));
log.debug(sr.toString());
}
log.debug("lookup {} {}, cache answer: {}", current, Type.string(type), sr);

processResponse(current, sr);
if (done || doneCurrent) {
return;
@@ -448,7 +446,7 @@ private void lookup(Name current) {
try {
response = resolver.send(query);
} catch (IOException e) {
log.debug("Lookup failed", e);
log.debug("Lookup failed using resolver {}", resolver, e);

// A network error occurred. Press on.
if (e instanceof InterruptedIOException) {
@@ -478,10 +476,8 @@ private void lookup(Name current) {
if (sr == null) {
sr = cache.lookupRecords(current, type, credibility);
}
if (log.isDebugEnabled()) {
log.debug("queried {} {}", current, Type.string(type));
log.debug(sr.toString());
}

log.debug("Queried {} {}: {}", current, Type.string(type), sr);
processResponse(current, sr);
}

@@ -344,4 +344,9 @@ private Message sendAXFR(Message query) throws IOException {
}
return response;
}

@Override
public String toString() {
return "SimpleResolver [" + address + "]";
}
}
@@ -0,0 +1 @@
org.slf4j.simpleLogger.defaultLogLevel=debug

0 comments on commit 9225d35

Please sign in to comment.
You can’t perform that action at this time.