diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/AfterReadinessCheckCallbackProcessor.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/AfterReadinessCheckCallbackProcessor.java index 6f117ca8d..81ab5ce2d 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/AfterReadinessCheckCallbackProcessor.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/AfterReadinessCheckCallbackProcessor.java @@ -42,8 +42,7 @@ */ public class AfterReadinessCheckCallbackProcessor { - private static Logger logger = HealthCheckLoggerFactory - .getLogger(AfterReadinessCheckCallbackProcessor.class); + private static Logger logger = HealthCheckLoggerFactory.DEFAULT_LOG; private ObjectMapper objectMapper = new ObjectMapper(); diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java index 47106eb75..f831e718f 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthCheckerProcessor.java @@ -16,17 +16,16 @@ */ package com.alipay.sofa.healthcheck; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.Collectors; - -import com.alipay.sofa.boot.error.ErrorCode; import com.alipay.sofa.boot.constant.SofaBootConstants; +import com.alipay.sofa.boot.error.ErrorCode; +import com.alipay.sofa.boot.health.NonReadinessCheck; +import com.alipay.sofa.boot.util.BinaryOperators; import com.alipay.sofa.healthcheck.core.HealthCheckExecutor; +import com.alipay.sofa.healthcheck.core.HealthChecker; +import com.alipay.sofa.healthcheck.log.HealthCheckLoggerFactory; +import com.alipay.sofa.healthcheck.util.HealthCheckUtils; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -35,13 +34,13 @@ import org.springframework.context.ApplicationContext; import org.springframework.util.Assert; -import com.alipay.sofa.boot.health.NonReadinessCheck; -import com.alipay.sofa.boot.util.BinaryOperators; -import com.alipay.sofa.healthcheck.core.HealthChecker; -import com.alipay.sofa.healthcheck.log.HealthCheckLoggerFactory; -import com.alipay.sofa.healthcheck.util.HealthCheckUtils; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; /** * Used to process all implementations of {@link HealthChecker} @@ -52,8 +51,7 @@ */ public class HealthCheckerProcessor { - private static Logger logger = HealthCheckLoggerFactory - .getLogger(HealthCheckerProcessor.class); + private static Logger logger = HealthCheckLoggerFactory.DEFAULT_LOG; private ObjectMapper objectMapper = new ObjectMapper(); diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthIndicatorProcessor.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthIndicatorProcessor.java index 3b6e9812e..fd1456900 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthIndicatorProcessor.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/HealthIndicatorProcessor.java @@ -58,8 +58,7 @@ * @version 2.3.0 */ public class HealthIndicatorProcessor { - private static Logger logger = HealthCheckLoggerFactory - .getLogger(HealthIndicatorProcessor.class); + private static Logger logger = HealthCheckLoggerFactory.DEFAULT_LOG; private static final List DEFAULT_EXCLUDE_INDICATORS = Arrays .asList( diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/ReadinessCheckListener.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/ReadinessCheckListener.java index cccacb92e..cee6f2c25 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/ReadinessCheckListener.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/ReadinessCheckListener.java @@ -52,8 +52,7 @@ */ public class ReadinessCheckListener implements ApplicationContextAware, Ordered, GenericApplicationListener { - private static Logger logger = HealthCheckLoggerFactory - .getLogger(ReadinessCheckListener.class); + private static Logger logger = HealthCheckLoggerFactory.DEFAULT_LOG; private final StatusAggregator statusAggregator = StatusAggregator .getDefault(); diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/core/HealthCheckExecutor.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/core/HealthCheckExecutor.java index a681f7812..454867597 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/core/HealthCheckExecutor.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/core/HealthCheckExecutor.java @@ -36,8 +36,7 @@ * @since 3.7.1 */ public class HealthCheckExecutor { - private static Logger logger = HealthCheckLoggerFactory - .getLogger(HealthCheckExecutor.class); + private static Logger logger = HealthCheckLoggerFactory.DEFAULT_LOG; private static final ThreadPoolExecutor THREAD_POOL_REF = createThreadPoolExecutor(); diff --git a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/log/HealthCheckLoggerFactory.java b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/log/HealthCheckLoggerFactory.java index d83de208b..e4588800e 100644 --- a/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/log/HealthCheckLoggerFactory.java +++ b/sofa-boot-project/sofa-boot-core/healthcheck-sofa-boot/src/main/java/com/alipay/sofa/healthcheck/log/HealthCheckLoggerFactory.java @@ -16,9 +16,8 @@ */ package com.alipay.sofa.healthcheck.log; -import org.slf4j.Logger; - import com.alipay.sofa.common.log.LoggerSpaceManager; +import org.slf4j.Logger; /** * @author liangen @@ -28,6 +27,9 @@ public class HealthCheckLoggerFactory { private static final String HEALTH_CHECK_LOG_SPACE = "com.alipay.sofa.healthcheck"; + public static final Logger DEFAULT_LOG = HealthCheckLoggerFactory + .getLogger("com.alipay.sofa"); + /*** * Get the log object *