input = new FileInputStream(mmagenthome + "/etc/mmagent.config");
logger.info("mmagenthome is set :" + mmagenthome + " loading properties at /etc/mmagent.config");
} catch (IOException ex) {
- logger.error(mmagenthome + "/etc/mmagent.config not found. Set -DMMAGENTHOME and check the config file");
+ logger.error(mmagenthome + "/etc/mmagent.config not found. Set -DMMAGENTHOME and check the config file" + ex);
return false;
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
- e.printStackTrace();
+ logger.error(" IOException occers " + e);
}
}
}
}
logger.info("kakahome is set :" + kafkahome);
} catch (IOException ex) {
- logger.error(kafkahome + "/bin/kafka-run-class.sh not found. Make sure kafka home is set correctly");
+ logger.error(kafkahome + "/bin/kafka-run-class.sh not found. Make sure kafka home is set correctly" + ex);
return false;
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
- e.printStackTrace();
+ logger.error("IOException" + e);
}
}
}
}
input = new FileInputStream(mmagenthome + "/etc/" + agentName + propName + ".properties");
} catch (IOException ex) {
+ logger.error(" IOException will be handled " + ex);
try {
input = new FileInputStream(mmagenthome + "/etc/" + propName + ".properties");
Properties prop = new Properties();
prop.store(out, "");
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("Exception at checkPropertiesFile " +e);
}
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
- e.printStackTrace();
+ logger.error("Exception occurred is " +e);
}
}
if (out != null) {
out.close();
} catch (IOException e) {
e.printStackTrace();
+ logger.error("IOException" + e);
}
}
}
}
} catch (Exception e) {
- e.printStackTrace();
+ logger.error("Exception is : " +e);
}
}
out.close();
} catch (IOException e) {
e.printStackTrace();
+ logger.error("IOException occered " + e);
}
}
}