summaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard/src/main
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-05-08 08:21:49 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-05-08 08:21:54 -0400
commit3a7d82430eed5f8c3abbff9e2bfd8fb978f526e9 (patch)
treef65d1953568f526a4683c7831f15c6868b4a5bac /controlloop/common/guard/src/main
parent002248883ff9134cd66e39147c062ad3936e1a74 (diff)
Add debugging of REST call
Debug should really be info not only to assist with debugging but it really should be tracked in the logs. Issue-ID: POLICY-1730 Change-Id: Ib94a60d67820747e594a6ea513e1fdaf1a4f6f48 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'controlloop/common/guard/src/main')
-rw-r--r--controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
index 2d43c885e..8ff226f7a 100644
--- a/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
+++ b/controlloop/common/guard/src/main/java/org/onap/policy/guard/PolicyGuardXacmlHelper.java
@@ -95,7 +95,7 @@ public class PolicyGuardXacmlHelper {
return response;
} catch (Exception e) {
- logger.error("Error in sending RESTful request: ", e);
+ logger.error("Exception in sending RESTful request: ", e);
}
return Util.DENY;
@@ -117,14 +117,20 @@ public class PolicyGuardXacmlHelper {
Map<String, String> headers = new HashMap<>();
headers.put("Accepts", "application/json");
+ logger.info("Guard Decision Request: {}", jsonBody);
+
Pair<Integer, String> httpDetails = restManager.post(url, user, pwd, headers, "application/json", jsonBody);
if (httpDetails == null) {
+ logger.error("Guard rest call returned a null pair - defaulting to DENY");
return Util.DENY;
}
+ logger.info("Guard Decision REST Response {} {}", httpDetails.first, httpDetails.second);
+
if (httpDetails.first == 200) {
DecisionResponse decision = coder.decode(httpDetails.second, DecisionResponse.class);
+ logger.info("Guard Decision {}", decision);
return decision.getStatus();
}