aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/org/onap')
-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())