From 05963e943e15fc653ea66fbf48854f1c608f035e Mon Sep 17 00:00:00 2001 From: "LaMont, William(wl2432)" Date: Wed, 15 Apr 2020 15:53:54 -0400 Subject: update resources processing for v19 Issue-ID: AAI-2865 Change-Id: I2431b1414fe44e0df2874e516f551ac4c596c575 Signed-off-by: LaMont, William(wl2432) --- .../interceptors/post/ResponseTransactionLogging.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/aai-resources/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java b/aai-resources/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java index bfc1636..2a573b3 100644 --- a/aai-resources/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java +++ b/aai-resources/src/main/java/org/onap/aai/interceptors/post/ResponseTransactionLogging.java @@ -58,11 +58,11 @@ public class ResponseTransactionLogging extends AAIContainerFilter implements Co private void transLogging(ContainerRequestContext requestContext, ContainerResponseContext responseContext) { String logValue; - String getValue; + String isGetTransactionResponseLoggingEnabled; try { logValue = AAIConfig.get("aai.transaction.logging"); - getValue = AAIConfig.get("aai.transaction.logging.get"); + isGetTransactionResponseLoggingEnabled = AAIConfig.get("aai.transaction.logging.get"); } catch (AAIException e) { return; } @@ -71,10 +71,6 @@ public class ResponseTransactionLogging extends AAIContainerFilter implements Co if(Boolean.parseBoolean(logValue)){ - if(!Boolean.parseBoolean(getValue) && HttpMethod.GET.equals(httpMethod)){ - return; - } - String transId = requestContext.getHeaderString(AAIHeaderProperties.TRANSACTION_ID); String fromAppId = requestContext.getHeaderString(AAIHeaderProperties.FROM_APP_ID); String fullUri = requestContext.getUriInfo().getRequestUri().toString(); @@ -84,7 +80,10 @@ public class ResponseTransactionLogging extends AAIContainerFilter implements Co String status = Integer.toString(responseContext.getStatus()); String request = (String) requestContext.getProperty(AAIHeaderProperties.AAI_REQUEST); - String response = this.getResponseString(responseContext); + String response = null; + if (!HttpMethod.GET.equals(httpMethod) || Boolean.parseBoolean(isGetTransactionResponseLoggingEnabled)) { + response = this.getResponseString(responseContext); + } JsonObject logEntry = new JsonObject(); @@ -96,7 +95,9 @@ public class ResponseTransactionLogging extends AAIContainerFilter implements Co logEntry.addProperty("resourceId", fullUri); logEntry.addProperty("resourceType", httpMethod); logEntry.addProperty("rqstBuf", Objects.toString(request, "")); - logEntry.addProperty("respBuf", Objects.toString(response, "")); + if (response != null ) { + logEntry.addProperty("respBuf", Objects.toString(response)); + } try { TRANSACTION_LOGGER.debug(logEntry.toString()); -- cgit 1.2.3-korg