From 4e2e2d0d44e0ad37b09a7b29211a620cf0b3690e Mon Sep 17 00:00:00 2001 From: rishumehrotra Date: Mon, 27 Jan 2020 14:58:53 +0530 Subject: [PATCH 1/4] Fixing https://github.com/testcontainers/testcontainers-java/issues/2253 --- .../org/testcontainers/utility/TestcontainersConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java index 64ee03efb06..4aa37e4212e 100644 --- a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java +++ b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java @@ -169,7 +169,7 @@ private static Properties readProperties(URL url) { try (InputStream inputStream = url.openStream()) { properties.load(inputStream); } catch (FileNotFoundException e) { - log.trace("Testcontainers config override was found on {} but the file was not found", url, e); + log.warn("Testcontainers config override was found on {} but the file was not found", url, e); } catch (IOException e) { log.warn("Testcontainers config override was found on {} but could not be loaded", url, e); } From 36a8ef10d0a7daa99a2abad6858b890c00318d12 Mon Sep 17 00:00:00 2001 From: rishumehrotra Date: Tue, 28 Jan 2020 07:41:47 +0530 Subject: [PATCH 2/4] adding ExceptionUtils --- .../testcontainers/utility/TestcontainersConfiguration.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java index 4aa37e4212e..7cfafa4d9cc 100644 --- a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java +++ b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java @@ -3,6 +3,7 @@ import com.google.common.annotations.VisibleForTesting; import lombok.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.exception.ExceptionUtils; import org.testcontainers.UnstableAPI; import java.io.*; @@ -169,9 +170,9 @@ private static Properties readProperties(URL url) { try (InputStream inputStream = url.openStream()) { properties.load(inputStream); } catch (FileNotFoundException e) { - log.warn("Testcontainers config override was found on {} but the file was not found", url, e); + log.warn("Testcontainers config override was found on {} but the file was not found", ExceptionUtils.getRootCauseMessage(e)); } catch (IOException e) { - log.warn("Testcontainers config override was found on {} but could not be loaded", url, e); + log.warn("Testcontainers config override was found on {} but could not be loaded", ExceptionUtils.getRootCauseMessage(e)); } return properties; } From f798e5c4f8ade457ad616dd2787f7700afaf1625 Mon Sep 17 00:00:00 2001 From: rishumehrotra Date: Sat, 1 Aug 2020 14:38:39 +0530 Subject: [PATCH 3/4] adding comments --- .../org/testcontainers/utility/TestcontainersConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java index 7cfafa4d9cc..879d9f1a9e2 100644 --- a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java +++ b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java @@ -170,7 +170,7 @@ private static Properties readProperties(URL url) { try (InputStream inputStream = url.openStream()) { properties.load(inputStream); } catch (FileNotFoundException e) { - log.warn("Testcontainers config override was found on {} but the file was not found", ExceptionUtils.getRootCauseMessage(e)); + log.warn("Testcontainers config override was found on {} but the file was not found. Exception message: {}", url, ExceptionUtils.getRootCauseMessage(e)); } catch (IOException e) { log.warn("Testcontainers config override was found on {} but could not be loaded", ExceptionUtils.getRootCauseMessage(e)); } From 7c7bf0326f9f48bea1f432c04d11b53f4ab9026e Mon Sep 17 00:00:00 2001 From: rishumehrotra Date: Sat, 1 Aug 2020 14:40:07 +0530 Subject: [PATCH 4/4] fixing log.warn --- .../org/testcontainers/utility/TestcontainersConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java index 879d9f1a9e2..ec670671e58 100644 --- a/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java +++ b/core/src/main/java/org/testcontainers/utility/TestcontainersConfiguration.java @@ -172,7 +172,7 @@ private static Properties readProperties(URL url) { } catch (FileNotFoundException e) { log.warn("Testcontainers config override was found on {} but the file was not found. Exception message: {}", url, ExceptionUtils.getRootCauseMessage(e)); } catch (IOException e) { - log.warn("Testcontainers config override was found on {} but could not be loaded", ExceptionUtils.getRootCauseMessage(e)); + log.warn("Testcontainers config override was found on {} but could not be loaded. Exception message: {}", url, ExceptionUtils.getRootCauseMessage(e)); } return properties; }