From 6242eeb5f77812079bf9381445885ff3839c123e Mon Sep 17 00:00:00 2001 From: vernedeng Date: Sat, 11 May 2024 11:19:57 +0800 Subject: [PATCH] fix log --- .../holder/v2/SortClusterConfigHolder.java | 4 +-- .../ClassResourceSortClusterConfigLoader.java | 2 +- .../v2/ManagerSortClusterConfigLoader.java | 4 +-- .../inlong/sort/standalone/v2/SortTask.java | 36 +++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/holder/v2/SortClusterConfigHolder.java b/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/holder/v2/SortClusterConfigHolder.java index 346d158731b..1f4de3c5ed0 100644 --- a/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/holder/v2/SortClusterConfigHolder.java +++ b/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/holder/v2/SortClusterConfigHolder.java @@ -74,7 +74,7 @@ private static SortClusterConfigHolder get() { instance.loader = (SortConfigLoader) loaderObject; } } catch (Throwable t) { - log.error("fail to init loader,loaderType:{},error:{}", loaderType, t.getMessage()); + log.error("fail to init loader, loaderType={}", loaderType); } } if (instance.loader == null) { @@ -119,7 +119,7 @@ private void reload() { this.config = newConfig; } } catch (Throwable e) { - log.error(e.getMessage(), e); + log.error("failed to reload sort config", e); } } diff --git a/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ClassResourceSortClusterConfigLoader.java b/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ClassResourceSortClusterConfigLoader.java index 4ed423333ff..ec559059f3d 100644 --- a/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ClassResourceSortClusterConfigLoader.java +++ b/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ClassResourceSortClusterConfigLoader.java @@ -57,7 +57,7 @@ public SortConfig load() { confString = confString.substring(index); return objectMapper.readValue(confString, SortConfig.class); } catch (Exception e) { - LOG.error("fail to load properties, file ={}, and e= {}", fileName, e); + LOG.error("fail to load properties, file ={}", fileName, e); } return SortConfig.builder().build(); } diff --git a/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ManagerSortClusterConfigLoader.java b/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ManagerSortClusterConfigLoader.java index 31a890c761e..ed63621b6a0 100644 --- a/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ManagerSortClusterConfigLoader.java +++ b/inlong-sort-standalone/sort-standalone-common/src/main/java/org/apache/inlong/sort/standalone/config/loader/v2/ManagerSortClusterConfigLoader.java @@ -96,13 +96,13 @@ public SortConfig load() { // request with get CloseableHttpResponse response = httpClient.execute(httpGet); String returnStr = EntityUtils.toString(response.getEntity()); - log.info("end to request {},result:{}", url, returnStr); + log.info("end to request {}, result={}", url, returnStr); // get groupId <-> topic and m value. SortConfigResponse clusterResponse = objectMapper.readValue(returnStr, SortConfigResponse.class); int errCode = clusterResponse.getCode(); if (errCode != SortConfigResponse.SUCC && errCode != SortConfigResponse.NO_UPDATE) { - log.info("Fail to get config info from url:{}, error code is {}, msg is {}", + log.info("fail to get config info from url={}, error code={}, msg={}", url, clusterResponse.getCode(), clusterResponse.getMsg()); return null; } diff --git a/inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/v2/SortTask.java b/inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/v2/SortTask.java index dd7fbe62bc4..72098436762 100644 --- a/inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/v2/SortTask.java +++ b/inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/v2/SortTask.java @@ -54,7 +54,7 @@ public void start() { } // Map flumeConfiguration = FlumeConfigGenerator.generateFlumeConfiguration(config); - log.info("Start sort task:{},config:{}", taskName, flumeConfiguration); + log.info("start sort task={}, config={}", taskName, flumeConfiguration); PropertiesConfigurationProvider configurationProvider = new PropertiesConfigurationProvider( config.getSortTaskName(), flumeConfiguration); this.handleConfigurationEvent(configurationProvider.getConfiguration()); @@ -71,7 +71,7 @@ public void handleConfigurationEvent(MaterializedConfiguration conf) { stopAllComponents(); startAllComponents(conf); } catch (InterruptedException e) { - log.error("Interrupted while trying to handle configuration event", e); + log.error("interrupted while trying to handle configuration event", e); } finally { // If interrupted while trying to lock, we don't own the lock, so must not attempt to unlock if (lifecycleLock.isHeldByCurrentThread()) { @@ -98,31 +98,31 @@ public void stop() { */ private void stopAllComponents() { if (this.materializedConfiguration != null) { - log.info("Shutting down configuration: {}", this.materializedConfiguration); + log.info("shutting down configuration: {}", this.materializedConfiguration); for (Map.Entry entry : this.materializedConfiguration.getSourceRunners().entrySet()) { try { - log.info("Stopping Source " + entry.getKey()); + log.info("stopping Source " + entry.getKey()); supervisor.unsupervise(entry.getValue()); } catch (Exception e) { - log.error("Error while stopping {}", entry.getValue(), e); + log.error("error while stopping {}", entry.getValue(), e); } } for (Map.Entry entry : this.materializedConfiguration.getSinkRunners().entrySet()) { try { - log.info("Stopping Sink " + entry.getKey()); + log.info("stopping Sink " + entry.getKey()); supervisor.unsupervise(entry.getValue()); } catch (Exception e) { - log.error("Error while stopping {}", entry.getValue(), e); + log.error("error while stopping {}", entry.getValue(), e); } } for (Map.Entry entry : this.materializedConfiguration.getChannels().entrySet()) { try { - log.info("Stopping Channel " + entry.getKey()); + log.info("stopping Channel " + entry.getKey()); supervisor.unsupervise(entry.getValue()); } catch (Exception e) { - log.error("Error while stopping {}", entry.getValue(), e); + log.error("error while stopping {}", entry.getValue(), e); } } } @@ -134,17 +134,17 @@ private void stopAllComponents() { * @param materializedConfiguration */ private void startAllComponents(MaterializedConfiguration materializedConfiguration) { - log.info("Starting new configuration:{}", materializedConfiguration); + log.info("starting new configuration:{}", materializedConfiguration); this.materializedConfiguration = materializedConfiguration; for (Map.Entry entry : materializedConfiguration.getChannels().entrySet()) { try { - log.info("Starting Channel " + entry.getKey()); + log.info("starting Channel " + entry.getKey()); supervisor.supervise(entry.getValue(), new LifecycleSupervisor.SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START); } catch (Exception e) { - log.error("Error while starting {}", entry.getValue(), e); + log.error("error while starting {}", entry.getValue(), e); } } @@ -155,31 +155,31 @@ private void startAllComponents(MaterializedConfiguration materializedConfigurat while (ch.getLifecycleState() != LifecycleState.START && !supervisor.isComponentInErrorState(ch)) { try { - log.info("Waiting for channel: " + ch.getName() + " to start. Sleeping for 500 ms"); + log.info("waiting for channel: " + ch.getName() + " to start. Sleeping for 500 ms"); Thread.sleep(500); } catch (InterruptedException e) { - log.error("Interrupted while waiting for channel to start.", e); + log.error("interrupted while waiting for channel to start.", e); } } } for (Map.Entry entry : materializedConfiguration.getSinkRunners().entrySet()) { try { - log.info("Starting Sink " + entry.getKey()); + log.info("starting Sink " + entry.getKey()); supervisor.supervise(entry.getValue(), new LifecycleSupervisor.SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START); } catch (Exception e) { - log.error("Error while starting {}", entry.getValue(), e); + log.error("error while starting {}", entry.getValue(), e); } } for (Map.Entry entry : materializedConfiguration.getSourceRunners().entrySet()) { try { - log.info("Starting Source " + entry.getKey()); + log.info("starting Source " + entry.getKey()); supervisor.supervise(entry.getValue(), new LifecycleSupervisor.SupervisorPolicy.AlwaysRestartPolicy(), LifecycleState.START); } catch (Exception e) { - log.error("Error while starting {}", entry.getValue(), e); + log.error("error while starting {}", entry.getValue(), e); } } }