diff options
Diffstat (limited to 'aai-els-onap-logging/src')
-rw-r--r-- | aai-els-onap-logging/src/main/java/org/onap/aai/aailog/filter/RestClientLoggingInterceptor.java | 15 | ||||
-rw-r--r-- | aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConfig.java | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/aai-els-onap-logging/src/main/java/org/onap/aai/aailog/filter/RestClientLoggingInterceptor.java b/aai-els-onap-logging/src/main/java/org/onap/aai/aailog/filter/RestClientLoggingInterceptor.java index 51824b74..629587d5 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/aai/aailog/filter/RestClientLoggingInterceptor.java +++ b/aai-els-onap-logging/src/main/java/org/onap/aai/aailog/filter/RestClientLoggingInterceptor.java @@ -19,22 +19,19 @@ */ package org.onap.aai.aailog.filter; +import java.io.IOException; +import java.util.List; +import java.util.UUID; import org.onap.aai.aailog.logs.ServiceName; import org.onap.logging.filter.base.AbstractMetricLogFilter; import org.onap.logging.filter.base.Constants; -import org.onap.logging.filter.base.MDCSetup; import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.slf4j.MDC; +import org.springframework.http.HttpHeaders; import org.springframework.http.HttpRequest; import org.springframework.http.client.ClientHttpRequestExecution; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.ClientHttpResponse; -import org.springframework.http.HttpHeaders; - -import javax.ws.rs.core.MultivaluedMap; -import java.io.IOException; -import java.util.List; -import java.util.UUID; public class RestClientLoggingInterceptor extends AbstractMetricLogFilter<HttpRequest, ClientHttpResponse, HttpHeaders> implements ClientHttpRequestInterceptor { @Override @@ -61,8 +58,8 @@ public class RestClientLoggingInterceptor extends AbstractMetricLogFilter<HttpRe String requestId = extractRequestID(requestHeaders); addHeader(requestHeaders, ONAPLogConstants.Headers.REQUEST_ID, requestId); addHeader(requestHeaders, Constants.HttpHeaders.HEADER_REQUEST_ID, requestId); - if (requestHeaders.getFirst(Constants.HttpHeaders.TRANSACTION_ID) == null || - requestHeaders.getFirst(Constants.HttpHeaders.TRANSACTION_ID).isEmpty()) { + String transactionId = requestHeaders.getFirst(Constants.HttpHeaders.TRANSACTION_ID); + if (transactionId == null || transactionId.isEmpty()) { addHeader(requestHeaders, Constants.HttpHeaders.TRANSACTION_ID, requestId); } addHeader(requestHeaders, Constants.HttpHeaders.ECOMP_REQUEST_ID, requestId); diff --git a/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConfig.java b/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConfig.java index 8d3e2cc8..2428f1e9 100644 --- a/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConfig.java +++ b/aai-els-onap-logging/src/main/java/org/onap/aai/util/AAIConfig.java @@ -58,7 +58,7 @@ public class AAIConfig { AAIConfig.getConfigFile(); AAIConfig.reloadConfig(); - if (AAIConstants.AAI_NODENAME == null || AAIConstants.AAI_NODENAME == "") { + if (AAIConstants.AAI_NODENAME == null || AAIConstants.AAI_NODENAME.equals("")) { ErrorLogHelper.logError("AAI_4005", " AAI_NODENAME is not defined"); } else { LOGGER.info("A&AI Server Node Name = " + AAIConstants.AAI_NODENAME); |