[CORD-1378]
SSH connection failures logged at a higher level
Trace log level records all command output
Change-Id: I18dad7eb82f7130e5ebbd1db32e1fb5f878bc8c3
diff --git a/src/main/java/org/opencord/cordvtn/impl/RemoteIpCommandUtil.java b/src/main/java/org/opencord/cordvtn/impl/RemoteIpCommandUtil.java
index 0821e83..4333b6c 100644
--- a/src/main/java/org/opencord/cordvtn/impl/RemoteIpCommandUtil.java
+++ b/src/main/java/org/opencord/cordvtn/impl/RemoteIpCommandUtil.java
@@ -193,7 +193,7 @@
return session;
} catch (JSchException e) {
- log.debug("Failed to connect to {} due to {}", sshInfo.toString(), e.toString());
+ log.error("Failed to connect to {} due to {}", sshInfo.toString(), e.toString());
return null;
}
}
@@ -234,9 +234,11 @@
String result = CharStreams.toString(new InputStreamReader(output));
channel.disconnect();
+ log.trace("Result of command {} on {}: {}", command, session.getHost(), result);
+
return result;
} catch (JSchException | IOException e) {
- log.debug("Failed to execute command {} due to {}", command, e.toString());
+ log.error("Failed to execute command {} on {} due to {}", command, session.getHost(), e.toString());
return null;
}
}