aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-04-30 14:07:58 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-30 14:07:58 +0000
commitae20d6d7bbda030af386a7f89146d73367333b5e (patch)
treeb9c0c3247922fbfae684d280ef8362184699dbc4
parentf280dcfe416a0bcd279a4a091593c9097c23ce3c (diff)
parent8973da059db915ad30d4a85797ed23a6df3801c8 (diff)
Merge "improve logging scores"
-rw-r--r--cxf-logging/src/main/java/org/onap/so/logging/cxf/interceptor/SOAPLoggingOutInterceptor.java4
-rw-r--r--deployment-configs/src/main/resources/logger/logback-spring.xml2
2 files changed, 5 insertions, 1 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);
diff --git a/deployment-configs/src/main/resources/logger/logback-spring.xml b/deployment-configs/src/main/resources/logger/logback-spring.xml
index 0e8d0a8222..258382b834 100644
--- a/deployment-configs/src/main/resources/logger/logback-spring.xml
+++ b/deployment-configs/src/main/resources/logger/logback-spring.xml
@@ -27,7 +27,7 @@
<property name="currentTimeStamp" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;,UTC}"/>
<property name="errorPattern"
- value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName:-Unknown}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode:-900}|%X{ErrorDesc:-UnknownError}|%msg%nopex%n" />
+ value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName:-Unknown}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode:-900}|%X{ErrorDesc:-UnknownError}|%replace(%msg){'\n',' '}%nopex%n" />
<property name="debugPattern"
value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%logger{50} - %msg%n" />