Skip to content

Commit

Permalink
Remove the extra forward slash from the resource name in api logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oshanath committed Oct 3, 2024
1 parent c2c3fc2 commit 9c77e72
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ public static void logAPI(String flow, MessageContext messageContext) {
ThreadContext.put("apiContext", selectedApi.getContext());
ThreadContext.put("apiVersion", selectedApi.getApiVersion());
if (messageContext.getProperty(API_TO) != null) {
String apiTo = "/" + messageContext.getProperty(API_TO);
ThreadContext.put("resourceName", apiTo.replaceFirst(selectedApi.getContext(), ""));
String apiTo = (String) messageContext.getProperty(API_TO);
String resourceName = apiTo.replaceFirst(selectedApi.getContext(), "");
if(resourceName.isEmpty()){
resourceName = "/";
}
ThreadContext.put("resourceName", resourceName);
}
}
ThreadContext.put("tenantDomain", (String) messageContext
Expand Down

0 comments on commit 9c77e72

Please sign in to comment.