diff options
author | 2018-11-20 07:31:32 -0500 | |
---|---|---|
committer | 2018-11-20 07:31:32 -0500 | |
commit | 7246eabfd23d6cadc9f658f666df62b93f30ed70 (patch) | |
tree | f60963a0eb52e3bf645491afa5c6ed9477dc28c7 /ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect | |
parent | ace477c7097f4dc48498916ba2e024a81513ed93 (diff) |
CADI Integration
Issue-ID: PORTAL-474
System to system authorization using CADI
Change-Id: I76487f8155a36fca8283669fe5e28ec7d5aec91d
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect')
-rw-r--r-- | ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java index d250591e..55a27837 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java @@ -42,11 +42,13 @@ import java.util.Date; import javax.servlet.http.HttpServletRequest; +import org.onap.portalsdk.core.domain.User; import org.onap.portalsdk.core.logging.format.AuditLogFormatter; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.service.AppService; import org.onap.portalsdk.core.util.SystemProperties; import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; +import org.onap.portalsdk.core.web.support.UserUtils; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; @@ -107,7 +109,13 @@ public class EELFLoggerAdvice { MDC.put(className + methodName + SystemProperties.AUDITLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); if (args[0] != null && args[0] instanceof HttpServletRequest) { HttpServletRequest req = (HttpServletRequest) args[0]; - logger.setRequestBasedDefaultsIntoGlobalLoggingContext(req, appName); + String requestId = UserUtils.getRequestId(req); + String loginId = ""; + User user = UserUtils.getUserSession(req); + if (user != null) { + loginId = user.getLoginId(); + } + logger.setRequestBasedDefaultsIntoGlobalLoggingContext(req, appName, requestId, loginId); } } logger.debug(EELFLoggerDelegate.debugLogger, "{} was invoked.", methodName); |