summaryrefslogtreecommitdiffstats
path: root/common/src/main
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-01-12 13:16:43 +0000
committerGerrit Code Review <gerrit@onap.org>2019-01-12 13:16:43 +0000
commit4919e6c13e741574d86c2e1993b302d80ec2128d (patch)
treee90ea1d11a0b0c254c7ecdf78a35c752a71d0b2c /common/src/main
parent2c0cafab25219c4814e11fffb2dc1d11df4f0cc0 (diff)
parent82d7dbd9d08c77b0fecf1b47393d50d81760e758 (diff)
Merge "updated logging to JaxRsFilterLogging"
Diffstat (limited to 'common/src/main')
-rw-r--r--common/src/main/java/org/onap/so/logger/LogConstants.java1
-rw-r--r--common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java2
-rw-r--r--common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java9
3 files changed, 3 insertions, 9 deletions
diff --git a/common/src/main/java/org/onap/so/logger/LogConstants.java b/common/src/main/java/org/onap/so/logger/LogConstants.java
index 2639adf304..3c8b7f7d56 100644
--- a/common/src/main/java/org/onap/so/logger/LogConstants.java
+++ b/common/src/main/java/org/onap/so/logger/LogConstants.java
@@ -24,4 +24,5 @@ public class LogConstants {
public static final String TARGET_ENTITY_HEADER="X-Target-Entity";
public static final String UNKNOWN_TARGET_ENTITY="Unknown-Target-Entity";
public static final String HTTP_URL="Http-Url";
+ public static final String URI_BASE="Uri-Base";
}
diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
index 85a6498748..7a99594d19 100644
--- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
+++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/JaxRsFilterLogging.java
@@ -40,6 +40,7 @@ import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import javax.ws.rs.ext.Providers;
import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.logger.LogConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
@@ -77,6 +78,7 @@ public class JaxRsFilterLogging implements ContainerRequestFilter,ContainerRespo
mdcSetup.setInstanceUUID();
mdcSetup.setEntryTimeStamp();
MDC.put(ONAPLogConstants.MDCs.RESPONSE_STATUS_CODE, ONAPLogConstants.ResponseStatus.INPROGRESS.toString());
+ MDC.put(LogConstants.URI_BASE, containerRequest.getUriInfo().getBaseUri().toString());
logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
} catch (Exception e) {
logger.warn("Error in incoming JAX-RS Inteceptor", e);
diff --git a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java b/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
index eeb8593725..9aa4e4c9b5 100644
--- a/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
+++ b/common/src/main/java/org/onap/so/logging/spring/interceptor/LoggingInterceptor.java
@@ -61,7 +61,6 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
setRequestId(headers);
setInvocationId(headers);
setServiceName(request);
- setHttpUrl(request);
setMDCPartnerName(headers);
mdcSetup.setClientIPAddress(request);
mdcSetup.setEntryTimeStamp();
@@ -112,14 +111,6 @@ public class LoggingInterceptor extends HandlerInterceptorAdapter {
MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, request.getRequestURI());
}
- protected void setHttpUrl(HttpServletRequest request) {
- String queryParams = "";
- if (request.getQueryString() != null) {
- queryParams = "?" + request.getQueryString();
- }
- MDC.put(LogConstants.HTTP_URL, request.getRequestURL() + queryParams);
- }
-
protected void setRequestId(Map<String, String> headers) {
String requestId=headers.get(ONAPLogConstants.Headers.REQUEST_ID.toLowerCase());
if(requestId == null || requestId.isEmpty())