MDC.put(ONAPLogConstants.MDCs.TARGET_ELEMENT, targetElement);
}
this.lastMsg = msg;
+ //During invoke status will always be INPROGRESS
+ MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
METRIC.info(INVOKE, "Invoke");
}
if (str != null) {
str = str.replaceAll("\\R", ""); // this will strip all new line characters
str = str.replaceAll("\\|", "%7C"); // log records should not contain a pipe, encode the pipe character
+ str = str.replaceAll("\t", " "); // tabs are not allowed, replace with spaces
+ str = str.replace(",", "\\,"); // comma must be escaped
}
return str;
}
assertEquals("%7C",output);
output = logger.formatString(null);
assertEquals(null,output);
+ output = logger.formatString("\t");
+ assertEquals(" ", output);
+ output = logger.formatString("one,two,three,");
+ assertEquals("one\\,two\\,three\\,", output);
}
-
}