Skip to content

Commit

Permalink
NMS-15776: Added some debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
christianpape committed Jul 11, 2023
1 parent bf7a890 commit e5b51f1
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public Response getHealth(int timeoutInMs, int maxAgeMs, UriInfo uriInfo) {
jsonHealth.put("healthy", false);
jsonHealth.put("errorMessage", errorMessage);
jsonHealth.put("responses", jsonResponseArray);

LOG.warn("BMRHGA - healthy: false");
LOG.warn("BMRHGA - errorMessage: " + errorMessage);
LOG.warn("BMRHGA - responses: " + jsonResponseArray);

return Pair.of(false, jsonHealth);
},
health -> {
Expand All @@ -97,17 +102,25 @@ public Response getHealth(int timeoutInMs, int maxAgeMs, UriInfo uriInfo) {
jsonHealth.put("healthy", health.isSuccess());
jsonHealth.put("errorMessage", (String) null);
jsonHealth.put("responses", jsonResponseArray);

LOG.warn("BMRHGA - healthy: " + health.isSuccess());
LOG.warn("BMRHGA - errorMessage: " + "null");
LOG.warn("BMRHGA - responses: " + jsonResponseArray);

for (var pair : health.getResponses()) {
final JSONObject eachJsonResponse = new JSONObject();
eachJsonResponse.put("status", pair.getRight().getStatus().name());
eachJsonResponse.put("description", pair.getLeft().getDescription());
eachJsonResponse.put("message", pair.getRight().getMessage());
LOG.warn("BMRHGA - status: " + pair.getRight().getStatus().name());
LOG.warn("BMRHGA - description: " + pair.getLeft().getDescription());
LOG.warn("BMRHGA - message: " + pair.getRight().getMessage());
jsonResponseArray.put(eachJsonResponse);
}
return Pair.of(health.isSuccess(), jsonHealth);
}
);
LOG.debug("Rest response : {}", flagAndResponse.getRight().toString());
LOG.warn("Rest response : {}", flagAndResponse.getRight().toString());
// Return response
return Response.ok()
.header("Health", flagAndResponse.getLeft() ? SUCCESS_MESSAGE : ERROR_MESSAGE)
Expand Down

0 comments on commit e5b51f1

Please sign in to comment.