private void executeCommand(String command, int logLevel) throws Exception{
Session session = getSshConnection().openSession();
try{
session.execCommand(command);
spooler_log.log(logLevel,"output to stdout for remote command: " + command);
stdout = new StreamGobbler(this.getSshSession().getStdout());
stderr = new StreamGobbler(this.getSshSession().getStderr());
BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(stdout));
while (true) {
String line = stdoutReader.readLine();
if (line == null) break;