aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-10-24 11:37:34 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-10-24 11:37:34 +0300
commitb4beb977c8dade82e27b37119992df817ecb67b5 (patch)
tree69f6dedc5a171a126988eb0002125a09b4bd11d5
parentd5ee5305be7f747aaddd3493485d6f029f72817b (diff)
don't add request id to MDC in VidLoggerAspect
Issue-ID: VID-253 request id is added to MDC by org.onap.logging.filter.spring.LoggingInterceptor so VidLoggerAspect don't need to add the request id to MDC Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: I8883de54f6775cfc80df6f45b8ec489841b5a97a
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java13
1 files changed, 1 insertions, 12 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java b/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
index f87297c37..08aaf09ce 100644
--- a/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
+++ b/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
@@ -32,7 +32,6 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
-import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.portalsdk.core.logging.aspect.EELFLoggerAdvice;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.service.AppService;
@@ -40,7 +39,6 @@ import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.portalsdk.core.web.support.UserUtils;
import org.onap.vid.controller.ControllersUtils;
import org.onap.vid.utils.SystemPropertiesWrapper;
-import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -92,7 +90,7 @@ public class VidLoggerAspect {
HttpServletRequest httpServletRequest = httpServletRequestOrNull(joinPoint);
fixSetRequestBasedDefaultsIntoGlobalLoggingContext(httpServletRequest,
joinPoint.getSignature().getDeclaringType().getName());
- addRequestIdToMdcForMetricFilter(httpServletRequest);
+
fixServerFqdnInMDC();
//Execute the actual method
@@ -111,14 +109,6 @@ public class VidLoggerAspect {
return result;
}
- //prepare MDC for org.onap.logging.filter.base.AbstractMetricLogFilter
- private void addRequestIdToMdcForMetricFilter(HttpServletRequest httpServletRequest) {
- if (httpServletRequest!=null) {
- String requestId = UserUtils.getRequestId(httpServletRequest);
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId);
- }
- }
-
// Set the status code into MDC *before* the metrics log is written by advice.after()
private void fixStatusCodeInMDC(String restStatus) {
EELFLoggerDelegate.mdcPut(SystemProperties.STATUS_CODE, restStatus);
@@ -166,7 +156,6 @@ public class VidLoggerAspect {
String loginId = controllersUtils.extractUserId(httpServletRequest);
logger.setRequestBasedDefaultsIntoGlobalLoggingContext(httpServletRequest, appName, requestId, loginId);
-
}
}