Skip to content
Permalink
Browse files
Still adding more logging in order to understand the random build fai…
…lures in Hudson.
  • Loading branch information
veithen committed May 15, 2010
1 parent 6ba24f8 commit 5b95776c3f9c9bea394a6a4a958abbc63e7977c5
Showing 1 changed file with 17 additions and 0 deletions.
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

@@ -62,6 +63,22 @@ public void sendMessage(ClientOptions options, ContentType contentType, byte[] m
OutputStream out = connection.getOutputStream();
out.write(message);
out.close();
if (connection instanceof HttpURLConnection) {
HttpURLConnection httpConnection = (HttpURLConnection)connection;
log.debug("Response code: " + httpConnection.getResponseCode());
log.debug("Response message: " + httpConnection.getResponseMessage());
int i = 0;
String headerValue;
while ((headerValue = httpConnection.getHeaderField(i)) != null) {
String headerName = httpConnection.getHeaderFieldKey(i);
if (headerName != null) {
log.debug(headerName + ": " + headerValue);
} else {
log.debug(headerValue);
}
i++;
}
}
InputStream in = connection.getInputStream();
IOUtils.copy(in, System.out);
in.close();

0 comments on commit 5b95776

Please sign in to comment.