From 3e52218ad1134b895f0e226442add59f7d9be751 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 25 Sep 2024 09:50:43 +0300 Subject: [PATCH] Cleanup logs of LoggingResourceTest --- .../main/java/io/quarkus/it/opentelemetry/SimpleResource.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java b/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java index aa1ef41f604cd..5abc30290a410 100644 --- a/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java +++ b/integration-tests/opentelemetry/src/main/java/io/quarkus/it/opentelemetry/SimpleResource.java @@ -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"; }