diff options
author | Steve Smokowski <ss835w@att.com> | 2019-01-12 13:16:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-12 13:16:43 +0000 |
commit | 4919e6c13e741574d86c2e1993b302d80ec2128d (patch) | |
tree | e90ea1d11a0b0c254c7ecdf78a35c752a71d0b2c /common/src | |
parent | 2c0cafab25219c4814e11fffb2dc1d11df4f0cc0 (diff) | |
parent | 82d7dbd9d08c77b0fecf1b47393d50d81760e758 (diff) |
Merge "updated logging to JaxRsFilterLogging"
Diffstat (limited to 'common/src')
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()) |