Skip to content

Commit

Permalink
aws debug interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
shalom938 committed Jul 7, 2024
1 parent b48f378 commit a1b92c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/digma/WithAWSDebug.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ public static Object intercept(@Origin Method method,
for (Object arg : allArguments) {
log.add("argument " + arg);
}
String url = allArguments.length > 0 ? (String) allArguments[0].toString() : null;

try {
return callable.call();
} catch (Throwable e) {
exception = e;
e.printStackTrace();
log.add("got exception in Digma interceptor for method " + method.getName() + ": " + e);
log.add("got exception in Digma interceptor for method " + method.getName() + ": " + e +" for url "+url);
throw e;
} finally {
log.add("exit Digma interceptor for method " + method.getName());
Expand All @@ -78,6 +79,7 @@ public static Object intercept(@Origin Method method,
}
if (exception != null){
PrintWriter writer = new PrintWriter(new FileOutputStream(logFile, true));
writer.println("exception stack trace for url " + url);
exception.printStackTrace(writer);
writer.close();
}
Expand Down

0 comments on commit a1b92c3

Please sign in to comment.