Skip to content

Commit

Permalink
Cleanup logs of LoggingResourceTest
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Sep 25, 2024
1 parent 3ec1df9 commit 3e52218
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ public TraceData pathParameters(@PathParam("paramId") String paramId) {
@Path("/exception")
public String exception() {
var exception = new RuntimeException("Exception!");
StackTraceElement[] trimmedStackTrace = new StackTraceElement[2];
System.arraycopy(exception.getStackTrace(), 0, trimmedStackTrace, 0, trimmedStackTrace.length);
exception.setStackTrace(trimmedStackTrace);
LOG.error("Oh no {}", exception.getMessage(), exception);
return "Oh no! An exception";
}
Expand Down

0 comments on commit 3e52218

Please sign in to comment.