diff options
author | Christopher Lott (cl778h) <clott@research.att.com> | 2017-10-04 08:32:30 -0400 |
---|---|---|
committer | Christopher Lott (cl778h) <clott@research.att.com> | 2017-10-04 08:33:33 -0400 |
commit | 88c674e9f243ee7bfacfca847383ea01b482c1c1 (patch) | |
tree | 86b9bcc94f5a27828a62a329886d0a9d0c4ff6b5 /ecomp-portal-BE-common/src/main | |
parent | b415db2e304f285c620e6084d29eda66988fd625 (diff) |
Repair aspect logger; repair site deploy
[PORTAL-54] Javadoc site deployment fails on widget-ms module
[PORTAL-116] WidgetCatalog request takes exception before reaching controller method
Issue: PORTAL-54, PORTAL-116
Change-Id: Id6d223a30a8c5f493c3fa1902225bc4e8964d085
Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/main')
-rw-r--r-- | ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java index 260c0f72..d095bbdb 100644 --- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java +++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java @@ -102,14 +102,11 @@ public class EPEELFLoggerAdvice { */ public Object[] before(SecurityEventTypeEnum securityEventType, Object[] args, Object[] passOnArgs) { String className = ""; - if (passOnArgs[0] != null) { + if (passOnArgs.length > 0 && passOnArgs[0] != null) className = passOnArgs[0].toString(); - } - String methodName = ""; - if (passOnArgs[1] != null) { + if (passOnArgs.length > 1 && passOnArgs[1] != null) methodName = passOnArgs[1].toString(); - } // Initialize Request defaults only for controller methods. MDC.put(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); @@ -119,7 +116,7 @@ public class EPEELFLoggerAdvice { MDC.put(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); HttpServletRequest req = null; - if (args[0] != null && args[0] instanceof HttpServletRequest) { + if (args.length > 0 && args[0] != null && args[0] instanceof HttpServletRequest) { req = (HttpServletRequest) args[0]; this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, methodName); } @@ -142,12 +139,11 @@ public class EPEELFLoggerAdvice { public void after(SecurityEventTypeEnum securityEventType, String statusCode, String responseCode, Object[] args, Object[] returnArgs, Object[] passOnArgs) { String className = ""; - if (passOnArgs[0] != null) + if (passOnArgs.length > 0 && passOnArgs[0] != null) className = passOnArgs[0].toString(); - // Method Name String methodName = ""; - if (passOnArgs[1] != null) + if (passOnArgs.length > 1 && passOnArgs[1] != null) methodName = passOnArgs[1].toString(); if (MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME) == null @@ -167,7 +163,7 @@ public class EPEELFLoggerAdvice { // Making sure to reload the INCOMING request MDC defaults if they have // been wiped out by either Outgoing or LDAP Phone book search // operations. - if (securityEventType != null && args[0] != null && args[0] instanceof HttpServletRequest + if (securityEventType != null && args.length > 0 && args[0] != null && args[0] instanceof HttpServletRequest && securityEventType == SecurityEventTypeEnum.INCOMING_REST_MESSAGE && (MDC.get(EPCommonSystemProperties.FULL_URL) == null || MDC.get(EPCommonSystemProperties.FULL_URL) == "")) { |