diff --git a/src/main/java/biz/paluch/logging/gelf/intern/sender/AbstractNioSender.java b/src/main/java/biz/paluch/logging/gelf/intern/sender/AbstractNioSender.java index f3fbac0f2..d5a945ad5 100644 --- a/src/main/java/biz/paluch/logging/gelf/intern/sender/AbstractNioSender.java +++ b/src/main/java/biz/paluch/logging/gelf/intern/sender/AbstractNioSender.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.net.InetAddress; +import java.net.PortUnreachableException; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.channels.ByteChannel; @@ -74,8 +75,11 @@ protected boolean isConnected() throws IOException { try { return channel.read(byteBuffer) >= 0; + } catch (PortUnreachableException e) { + errorReporter.reportError("Port " + getHost() + ":" + getPort() + " not reachable", e); } catch (IOException e) { - errorReporter.reportError(e.getMessage(), e); + errorReporter.reportError("Cannot verify whether channel to " + getHost() + ":" + getPort() + " is connected: " + + e.getMessage(), e); } }