From 1f35c808cd71a18b5c5f68a25a3a41acd29692bd Mon Sep 17 00:00:00 2001 From: jaslou Date: Tue, 10 Oct 2023 16:04:07 +0800 Subject: [PATCH] [ISSUE-3075][Improve] Improve streampark-console module base on [5 Log] #3075 (#3229) Co-authored-by: jaslou --- .../streampark/console/core/aspect/ConsoleAspect.java | 8 ++++++-- .../core/service/impl/FlinkClusterServiceImpl.java | 2 +- .../console/core/websocket/WebSocketEndpoint.java | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/ConsoleAspect.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/ConsoleAspect.java index 15926c4afc..303730bb94 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/ConsoleAspect.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/aspect/ConsoleAspect.java @@ -73,7 +73,9 @@ public void apiAccess() {} @Around(value = "apiAccess()") public RestResponse apiAccess(ProceedingJoinPoint joinPoint) throws Throwable { MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); - log.debug("restResponse aspect, method:{}", methodSignature.getName()); + if (log.isDebugEnabled()) { + log.debug("restResponse aspect, method:{}", methodSignature.getName()); + } Boolean isApi = (Boolean) SecurityUtils.getSubject().getSession().getAttribute(AccessToken.IS_API_TOKEN); if (Objects.nonNull(isApi) && isApi) { @@ -91,7 +93,9 @@ public void appUpdated() {} @Around("appUpdated()") public Object appUpdated(ProceedingJoinPoint joinPoint) throws Throwable { MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); - log.debug("appUpdated aspect, method:{}", methodSignature.getName()); + if (log.isDebugEnabled()) { + log.debug("appUpdated aspect, method:{}", methodSignature.getName()); + } Object target = joinPoint.proceed(); flinkAppHttpWatcher.init(); return target; diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java index 3dabd573d1..40cdff909e 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkClusterServiceImpl.java @@ -438,7 +438,7 @@ private DeployResponse deployInternal(FlinkCluster flinkCluster) flinkCluster.getClusterId(), flinkCluster.getId(), getKubernetesDeployDesc(flinkCluster, "start")); - log.info("Deploy cluster request " + deployRequest); + log.info("Deploy cluster request {}", deployRequest); Future future = executorService.submit(() -> FlinkClient.deploy(deployRequest)); return future.get(60, TimeUnit.SECONDS); } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/websocket/WebSocketEndpoint.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/websocket/WebSocketEndpoint.java index 1524a6ca4d..3872b90519 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/websocket/WebSocketEndpoint.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/websocket/WebSocketEndpoint.java @@ -47,7 +47,9 @@ public class WebSocketEndpoint { @OnOpen public void onOpen(Session session, @PathParam("id") String id) { - log.debug("websocket onOpen...."); + if (log.isDebugEnabled()) { + log.debug("websocket onOpen...."); + } this.id = id; this.session = session; SOCKET_SESSIONS.put(id, session); @@ -55,7 +57,9 @@ public void onOpen(Session session, @PathParam("id") String id) { @OnClose public void onClose() throws IOException { - log.debug("websocket onClose...."); + if (log.isDebugEnabled()) { + log.debug("websocket onClose...."); + } this.session.close(); SOCKET_SESSIONS.remove(this.id); }