From 35cfd825fbaf28e1959a1e565606f0e2724d90fe Mon Sep 17 00:00:00 2001 From: James Netherton Date: Tue, 13 Aug 2024 11:48:09 +0100 Subject: [PATCH] Add capability to set the localstack log level Fixes #5544 --- .../camel/quarkus/test/support/aws2/Aws2TestResource.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java index 932dd3f247c0..a86fdf4f36f6 100644 --- a/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java +++ b/integration-tests-support/aws2/src/test/java/org/apache/camel/quarkus/test/support/aws2/Aws2TestResource.java @@ -65,6 +65,11 @@ public Map start() { if (usingMockBackend) { MockBackendUtils.logMockBackendUsed(); + String localstackLogLevel = System.getProperty("localstack.log.level", System.getenv("LOCALSTACK_LOG_LEVEL")); + if (localstackLogLevel == null) { + localstackLogLevel = "info"; + } + final Service[] services = customizers.stream() .map(Aws2TestEnvCustomizer::localstackServices) .flatMap((Service[] ss) -> Stream.of(ss)) @@ -82,6 +87,7 @@ public Map start() { .asCompatibleSubstituteFor("localstack/localstack"); LocalStackContainer localstack = new LocalStackContainer(imageName) .withServices(services); + localstack.withEnv("LS_LOG", localstackLogLevel); localstack.withEnv("LAMBDA_EXECUTOR", "local"); localstack.withLogConsumer(new Slf4jLogConsumer(LOG)); localstack.start();