Add the Stacktrace into the Log 87/22887/1
authorGuangrong Fu <fu.guangrong@zte.com.cn>
Thu, 9 Nov 2017 07:54:02 +0000 (15:54 +0800)
committerGuangrong Fu <fu.guangrong@zte.com.cn>
Thu, 9 Nov 2017 07:54:02 +0000 (15:54 +0800)
Change-Id: I8b9274e05ae0c5885455ae303819748f8bf7949e
Issue-ID: HOLMES-86
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
holmes-actions/src/main/java/org/onap/holmes/common/aai/CorrelationUtil.java
holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationsCache.java
holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
holmes-actions/src/main/java/org/onap/holmes/common/producer/MQProducer.java
holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java

index 9295f53..6520552 100644 (file)
@@ -60,7 +60,7 @@ public class CorrelationUtil {
         try {
             vmEntity = aaiQuery.getAaiVmData(rootSourceId, rootSourceName);
         } catch (CorrelationException e) {
-            log.error("Failed to get vm data", e.getMessage());
+            log.error("Failed to get the VM data.", e);
         }
         return vmEntity;
     }
index 8646abe..2503ce2 100644 (file)
  */
 package org.onap.holmes.common.dcae;
 
+import lombok.extern.slf4j.Slf4j;
 import org.onap.holmes.common.dcae.entity.DcaeConfigurations;
 import org.onap.holmes.common.dcae.entity.SecurityInfo;
 
+@Slf4j
 public class DcaeConfigurationsCache {
 
     private static DcaeConfigurations dcaeConfigurations = new DcaeConfigurations();
index 738bfd9..f2fd3a1 100644 (file)
@@ -50,11 +50,11 @@ public class DmaapService {
             publisher.publish(policyMsg);
             log.info("send policyMsg: " + JacksonUtil.beanToJson(policyMsg));
         } catch (CorrelationException e) {
-            log.error("Failed to publish policyMsg to dmaap", e.getMessage());
+            log.error("Failed to publish the control loop event to DMaaP", e);
         } catch (JsonProcessingException e) {
-            log.info("Failed to convert policyMsg to json");
+            log.info("Failed to convert the control loop event to json");
         } catch (NullPointerException e) {
-            log.error("DMaaP configurations does not exist!");
+            log.error("DMaaP configurations do not exist!");
         }
     }
 
@@ -155,7 +155,7 @@ public class DmaapService {
         try {
             vnfEntity = aaiQuery.getAaiVnfData(vnfId, vnfName);
         } catch (CorrelationException e) {
-            log.error("Failed to get vnf data", e.getMessage());
+            log.error("Failed to get the VNF data.", e);
         }
         return vnfEntity;
     }
@@ -165,7 +165,7 @@ public class DmaapService {
         try {
             vmEntity = aaiQuery.getAaiVmData(sourceId, sourceName);
         } catch (CorrelationException e) {
-            log.error("Failed to get vm data", e.getMessage());
+            log.error("Failed to get the VM data.", e);
         }
         return vmEntity;
     }
index 9483bb6..fd91bbd 100644 (file)
@@ -84,13 +84,13 @@ public class MQProducer {
             messageProducer.send(message);\r
             session.commit();\r
         } catch (Exception e) {\r
-            log.error("Failed send correlation." + e.getMessage(), e);\r
+            log.error("Failed send correlation. " + e.getMessage(), e);\r
         } finally {\r
             if (connection != null) {\r
                 try {\r
                     connection.close();\r
                 } catch (JMSException e) {\r
-                    log.error("Failed close connection." + e.getMessage(), e);\r
+                    log.error("Failed close connection. " + e.getMessage(), e);\r
                 }\r
             }\r
         }\r
index 0c93c42..3d3c827 100644 (file)
@@ -74,7 +74,7 @@ public class HttpsUtils {
             connectionManager = new PoolingHttpClientConnectionManager(registry);
             connectionManager.setMaxTotal(200);
         } catch (Exception e) {
-            log.error("Failed to initialize the ssl builder: " + e.getMessage());
+            log.error("Failed to initialize the ssl builder: " + e.getMessage(), e);
         }
     }