diff options
author | Plummer, Brittany <brittany.plummer@att.com> | 2020-04-29 15:28:15 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-04-29 15:28:16 -0400 |
commit | 8973da059db915ad30d4a85797ed23a6df3801c8 (patch) | |
tree | c632ff08fe325c9e147178da452ecd29d1e2ac94 /cxf-logging/src/main/java/org/onap | |
parent | 37a2d93feb1dc910e7b09443369083fd49766f89 (diff) |
improve logging scores
Replaced newlines in error message
Added setting elapsedTime in SOAPLoggingOutInterceptor
Issue-ID: SO-2851
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I55033eb8575519f42f3458254ea5e37db99725d0
Diffstat (limited to 'cxf-logging/src/main/java/org/onap')
-rw-r--r-- | cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java index 3785d3165f..a03637831a 100644 --- a/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java +++ b/cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java @@ -26,6 +26,7 @@ import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.Message; import org.apache.cxf.phase.Phase; +import org.onap.logging.filter.base.MDCSetup; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,6 +49,7 @@ public class SOAPLoggingOutInterceptor extends AbstractSoapInterceptor { @Override public void handleMessage(SoapMessage message) throws Fault { try { + MDCSetup mdcSetup = new MDCSetup(); Exception ex = message.getContent(Exception.class); if (ex == null) { MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, @@ -62,6 +64,8 @@ public class SOAPLoggingOutInterceptor extends AbstractSoapInterceptor { MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.ERROR.toString()); } + mdcSetup.setLogTimestamp(); + mdcSetup.setElapsedTime(); logger.info(ONAPLogConstants.Markers.EXIT, "Exiting"); } catch (Exception e) { logger.warn("Error in incoming SOAP Message Inteceptor", e); |