Service logic logging fixes 47/26447/1
authorDan Timoney <dtimoney@att.com>
Mon, 18 Dec 2017 16:58:35 +0000 (11:58 -0500)
committerDan Timoney <dtimoney@att.com>
Mon, 18 Dec 2017 16:58:35 +0000 (11:58 -0500)
Update MetricLogger class to properly escape characters within body
of response.  Also, used SvcLogicGraph.toString method to simplify
logging call.

Change-Id: I6bcaaf3c67032df041c6d37372016990ff0199d3
Issue-ID: CCSDK-152
Signed-off-by: Dan Timoney <dtimoney@att.com>
sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/MetricLogger.java
sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicParser.java

index 79989b5..e70d08a 100644 (file)
@@ -169,7 +169,7 @@ public class MetricLogger {
     }
 
     private void setResponseDescription(String responseDesc) {
-        MDC.put(RESPONSE_DESCRIPTION, responseDesc);
+        MDC.put(RESPONSE_DESCRIPTION, formatString(responseDesc));
     }
 
     public String getInstanceUUID() {
index ee26043..51eb18e 100644 (file)
@@ -487,13 +487,8 @@ public class SvcLogicParser {
 
         for (SvcLogicGraph graph : graphs) {
 
-            String module = graph.getModule();
-            String rpc = graph.getRpc();
-            String version = graph.getVersion();
-            String mode = graph.getMode();
             try {
-                LOGGER.info("Saving SvcLogicGraph to database (module:{},rpc:{},mode:{},version:{})", module, rpc, mode,
-                        version);
+                LOGGER.info("Saving " + graph.toString() + " to database.");
                 store.store(graph);
             } catch (Exception e) {
                 throw new SvcLogicException(e.getMessage(), e);