You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampark.apache.org by ac...@apache.org on 2024/05/21 01:58:35 UTC

(incubator-streampark) branch dev updated: [Imporve] Optimize log printing in GlobalExceptionHandler (#3707)

This is an automated email from the ASF dual-hosted git repository.

achao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new a4a266e56 [Imporve] Optimize log printing in GlobalExceptionHandler (#3707)
a4a266e56 is described below

commit a4a266e5634f3384a8ea27ffdf363b398e5343cc
Author: Cancai Cai <77...@users.noreply.github.com>
AuthorDate: Tue May 21 09:58:30 2024 +0800

    [Imporve] Optimize log printing in GlobalExceptionHandler (#3707)
    
    [Imporve] Optimize log printing in GlobalExceptionHandler
---
 .../streampark/console/base/handler/GlobalExceptionHandler.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/handler/GlobalExceptionHandler.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/handler/GlobalExceptionHandler.java
index 6ff362f96..1f669eb96 100644
--- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/handler/GlobalExceptionHandler.java
+++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/handler/GlobalExceptionHandler.java
@@ -52,14 +52,14 @@ public class GlobalExceptionHandler {
   @ExceptionHandler(value = Exception.class)
   @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
   public RestResponse handleException(Exception e) {
-    log.info("Internal server error:", e);
+    log.error("Internal server error:", e);
     return RestResponse.fail(ResponseCode.CODE_FAIL, "internal server error: {}", e.getMessage());
   }
 
   @ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
   @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
   public RestResponse handleException(HttpRequestMethodNotSupportedException e) {
-    log.info("not supported request method,exception:{}", e.getMessage());
+    log.error("not supported request method,exception:{}", e);
     return RestResponse.fail(
         ResponseCode.CODE_FAIL, "not supported request method,exception:{}", e.getMessage());
   }
@@ -67,7 +67,7 @@ public class GlobalExceptionHandler {
   @ExceptionHandler(value = AbstractApiException.class)
   @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
   public RestResponse handleException(AbstractApiException e) {
-    log.info("api exception:{}", e.getMessage());
+    log.error("api exception:{}", e);
     return RestResponse.fail(e.getResponseCode(), e.getMessage());
   }
 
@@ -113,6 +113,6 @@ public class GlobalExceptionHandler {
   @ExceptionHandler(value = UnauthorizedException.class)
   @ResponseStatus(HttpStatus.FORBIDDEN)
   public void handleUnauthorizedException(Exception e) {
-    log.info("Permission denied,{}", e.getMessage());
+    log.error("Permission denied,{}", e);
   }
 }