diff options
-rw-r--r-- | server/src/main/java/org/onap/usecaseui/server/util/HttpUtil.java | 7 | ||||
-rw-r--r-- | server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/util/HttpUtil.java b/server/src/main/java/org/onap/usecaseui/server/util/HttpUtil.java index 9ac0afc8..07514660 100644 --- a/server/src/main/java/org/onap/usecaseui/server/util/HttpUtil.java +++ b/server/src/main/java/org/onap/usecaseui/server/util/HttpUtil.java @@ -24,6 +24,7 @@ import java.net.URLConnection; import java.util.List; import java.util.Map; +import com.google.common.base.Throwables; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,7 +74,7 @@ public class HttpUtil { } } catch (Exception e) { logger.error("发送GET请求出现异常!" + e); - e.printStackTrace(); + logger.error("发送GET请求出现异常!" + Throwables.getStackTraceAsString(e)); } // 使用finally块来关闭输入流 finally { @@ -82,7 +83,7 @@ public class HttpUtil { in.close(); } } catch (Exception e2) { - e2.printStackTrace(); + logger.error("Exception occured while closing the connection {}" + Throwables.getStackTraceAsString(e2)); } } return result; @@ -128,7 +129,7 @@ public class HttpUtil { } } catch (Exception e) { logger.error("发送 POST 请求出现异常!"+e); - e.printStackTrace(); + logger.error("发送 POST 请求出现异常!"+Throwables.getStackTraceAsString(e)); } //使用finally块来关闭输出流、输入流 finally{ diff --git a/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java b/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java index 5c8a13f2..837abee9 100644 --- a/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java +++ b/server/src/main/java/org/onap/usecaseui/server/util/UuiCommonUtil.java @@ -27,6 +27,7 @@ import java.util.UUID; import javax.servlet.http.HttpServletRequest; +import com.google.common.base.Throwables; import org.apache.commons.io.FileUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -113,7 +114,7 @@ public class UuiCommonUtil { } } catch (IOException e) { logger.error("exception occurred while performing UuiCommonUtil OutRequestBody.Details:"+ e.getMessage()); - e.printStackTrace(); + logger.error("exception occurred while performing UuiCommonUtil OutRequestBody.Details:"+ Throwables.getStackTraceAsString(e)); } return wholeStr; } |