Fix critical sonar issues in messagerouter/mirroragent
[dmaap/messagerouter/mirroragent.git] / src / main / java / org / onap / dmaap / mr / dmaapMMAgent / utils / MirrorMakerProcessHandler.java
index 9b5f863..883d151 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.log4j.Logger;
 
 public class MirrorMakerProcessHandler {
        static final Logger logger = Logger.getLogger(MirrorMakerProcessHandler.class);
-       static String mmagenthome = System.getProperty("MMAGENTHOME");
+       static String mmagenthome = "/opt";
 
        public static boolean checkMirrorMakerProcess(String agentname, boolean enablelogCheck, String grepLog) throws Exception {
                String line,linelog;
@@ -135,7 +135,7 @@ public class MirrorMakerProcessHandler {
 
                        logger.info("Mirror Maker " + agentname + " Stopped");
                } catch (Exception e) {
-                       e.printStackTrace();
+                   logger.error("exception occured in stopMirrorMaker ", e);
                }
 
        }
@@ -163,7 +163,7 @@ public class MirrorMakerProcessHandler {
                                                                // System.out.println(line);
                                                        }
                                                } catch (Exception anExc) {
-                                                       anExc.printStackTrace();
+                                                   logger.error("exception occured in startMirrorMaker ", anExc);
                                                }
                                        }
                                }.start();
@@ -185,7 +185,7 @@ public class MirrorMakerProcessHandler {
                                                                // System.out.println(line);
                                                        }
                                                } catch (Exception anExc) {
-                                                       anExc.printStackTrace();
+                                                   logger.error("exception occured in startMirrorMaker ", anExc);
                                                }
                                        }
                                }.start();
@@ -194,7 +194,7 @@ public class MirrorMakerProcessHandler {
                        logger.info("Mirror Maker " + agentName + " Started" + " WhiteListing:" + whitelist);
 
                } catch (Exception e) {
-                       e.printStackTrace();
+                   logger.error("exception occured in startMirrorMaker ", e);
                }
        }
 }