Skip to content

Commit

Permalink
Merge pull request #12626 from Oshanath/master
Browse files Browse the repository at this point in the history
Remove the extra forward slash from the resource name in api logs.
  • Loading branch information
RakhithaRR authored Oct 5, 2024
2 parents 5227c4f + 9c77e72 commit e454223
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 e454223

Please sign in to comment.