From 1cc0d953d44c48884d8417d1612b08f7402e5be2 Mon Sep 17 00:00:00 2001 From: Vahid Hashemian Date: Tue, 5 Mar 2024 14:04:51 -0800 Subject: [PATCH] Skip logging stacktrace for EC2 detection --- psc/src/main/java/com/pinterest/psc/common/PscUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/psc/src/main/java/com/pinterest/psc/common/PscUtils.java b/psc/src/main/java/com/pinterest/psc/common/PscUtils.java index bcd57cc..7721d66 100644 --- a/psc/src/main/java/com/pinterest/psc/common/PscUtils.java +++ b/psc/src/main/java/com/pinterest/psc/common/PscUtils.java @@ -42,7 +42,7 @@ protected static boolean doesEc2MetadataExist() { Process process = processBuilder.start(); return process.waitFor() == 0; } catch (Exception e) { - logger.info("Could not detect if host is EC2 from ec2metadata.", e); + logger.info("Could not detect if host is EC2 from ec2metadata.", e.getMessage()); return false; } } @@ -51,7 +51,7 @@ protected static boolean isSysVendorAws() { try { return getFileContent("/sys/devices/virtual/dmi/id/sys_vendor").trim().equals("Amazon EC2"); } catch (Exception e) { - logger.info("Could not detect if host is EC2 from sys vendor.", e); + logger.info("Could not detect if host is EC2 from sys vendor.", e.getMessage()); return false; } } @@ -60,7 +60,7 @@ protected static boolean isAwsOsDetected() { try { return System.getProperty("os.version").contains("aws"); } catch (Exception e) { - logger.info("Could not detect if host is EC2 from os version.", e); + logger.info("Could not detect if host is EC2 from os version.", e.getMessage()); return false; } }