소스 검색

eureka 不再依赖 log 模块

reghao 9 달 전
부모
커밋
3522665585

+ 0 - 6
eureka/eureka-server/pom.xml

@@ -18,12 +18,6 @@
     </properties>
 
     <dependencies>
-        <dependency>
-            <groupId>cn.reghao.tnb</groupId>
-            <artifactId>log</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
-        </dependency>
-
         <dependency>
             <groupId>cn.reghao.tnb.eureka</groupId>
             <artifactId>eureka-api</artifactId>

+ 0 - 31
eureka/eureka-server/src/main/java/cn/reghao/tnb/eureka/server/config/SpringLifecycle.java

@@ -1,18 +1,11 @@
 package cn.reghao.tnb.eureka.server.config;
 
-import cn.reghao.jutil.jdk.machine.id.MachineId;
-import cn.reghao.jutil.jdk.machine.id.MachineIdLinux;
-import cn.reghao.tnb.log.Appenders;
-import cn.reghao.tnb.log.LoggerConfig;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.ApplicationRunner;
-import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-
 /**
  * @author reghao
  * @date 2022-03-23 09:22:01
@@ -20,35 +13,11 @@ import java.util.List;
 @Slf4j
 @Component
 public class SpringLifecycle implements ApplicationRunner, DisposableBean {
-    private final Environment env;
-    private final MachineId machineId;
-    private final LogProperties logProperties;
-
-    public SpringLifecycle(Environment env, LogProperties logProperties) {
-        this.env = env;
-        this.machineId = new MachineIdLinux();
-        this.logProperties = logProperties;
-    }
-
     @Override
     public void run(ApplicationArguments args) throws Exception {
-        if (logProperties.getEnabled()) {
-            initLogConfig();
-        }
         log.info("EurekaServer 启动...");
     }
 
-    private void initLogConfig() {
-        String wsUrl = logProperties.getWsUrl();
-        if (wsUrl != null) {
-            String token = logProperties.getToken();
-            String app = env.getProperty("spring.application.name");
-            String host = machineId.ipv4();
-            String url = String.format("%s?token=%s&app=%s&host=%s", wsUrl, token, app, host);
-            LoggerConfig.initLogger(List.of(Appenders.wsAppender(url, app, host)));
-        }
-    }
-
     @Override
     public void destroy() {
         log.info("EurekaServer 停止...");

+ 0 - 4
eureka/eureka-server/src/main/resources/application-dev.yml

@@ -1,7 +1,3 @@
-log:
-  enabled: false
-  ws-url: ws://bnt.reghao.cn/ws/log/push
-  token: 012345678
 dubbo:
   registry:
     address: zookeeper://localhost:2181

+ 0 - 4
eureka/eureka-server/src/main/resources/application-test.yml

@@ -1,7 +1,3 @@
-log:
-  enabled: false
-  ws-url: ws://bnt.reghao.cn/ws/log/push
-  token: 012345678
 dubbo:
   registry:
     address: zookeeper://192.168.0.209:2181