Bläddra i källkod

update tlog 1.3.4 => 1.3.5 启用 tlog 自动配置

疯狂的狮子li 3 år sedan
förälder
incheckning
8f8e796c77

+ 3 - 19
pom.xml

@@ -34,7 +34,7 @@
         <redisson.version>3.16.4</redisson.version>
         <lock4j.version>2.2.1</lock4j.version>
         <dynamic-ds.version>3.4.1</dynamic-ds.version>
-        <tlog.version>1.3.4</tlog.version>
+        <tlog.version>1.3.5</tlog.version>
         <xxl-job.version>2.3.0</xxl-job.version>
 
         <!-- jdk11 缺失依赖 jaxb-->
@@ -203,29 +203,13 @@
 
             <dependency>
                 <groupId>com.yomahub</groupId>
-                <artifactId>tlog-spring-boot-configuration</artifactId>
+                <artifactId>tlog-web-spring-boot-starter</artifactId>
                 <version>${tlog.version}</version>
             </dependency>
 
             <dependency>
                 <groupId>com.yomahub</groupId>
-                <artifactId>tlog-webroot</artifactId>
-                <version>${tlog.version}</version>
-                <exclusions>
-                    <exclusion>
-                        <artifactId>javassist</artifactId>
-                        <groupId>org.javassist</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>guava</artifactId>
-                        <groupId>com.google.guava</groupId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
-                <groupId>com.yomahub</groupId>
-                <artifactId>tlog-xxl-job</artifactId>
+                <artifactId>tlog-xxljob-spring-boot-starter</artifactId>
                 <version>${tlog.version}</version>
             </dependency>
 

+ 0 - 10
ruoyi-common/pom.xml

@@ -140,16 +140,6 @@
             <artifactId>lock4j-redisson-spring-boot-starter</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>com.yomahub</groupId>
-            <artifactId>tlog-spring-boot-configuration</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.yomahub</groupId>
-            <artifactId>tlog-webroot</artifactId>
-        </dependency>
-
     </dependencies>
 
 </project>

+ 5 - 0
ruoyi-framework/pom.xml

@@ -63,6 +63,11 @@
             <artifactId>ruoyi-common</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.yomahub</groupId>
+            <artifactId>tlog-web-spring-boot-starter</artifactId>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 4 - 4
ruoyi-framework/src/main/java/com/ruoyi/framework/Interceptor/PlusWebInvokeTimeInterceptor.java

@@ -35,14 +35,14 @@ public class PlusWebInvokeTimeInterceptor extends AbsTLogWebHandlerMethodInterce
             // 打印请求参数
             if (isJsonRequest(request)) {
                     String jsonParam = new RequestWrapper(request).getBodyString();
-                    log.info("[PLUS]开始请求 => URL[{}],参数类型[json],参数:[{}]", url, jsonParam);
+                    log.debug("[PLUS]开始请求 => URL[{}],参数类型[json],参数:[{}]", url, jsonParam);
             } else {
                 Map<String, String[]> parameterMap = request.getParameterMap();
                 if (MapUtil.isNotEmpty(parameterMap)) {
                     String parameters = JsonUtils.toJsonString(parameterMap);
-                    log.info("[PLUS]开始请求 => URL[{}],参数类型[param],参数:[{}]", url, parameters);
+                    log.debug("[PLUS]开始请求 => URL[{}],参数类型[param],参数:[{}]", url, parameters);
                 } else {
-                    log.info("[PLUS]开始请求 => URL[{}],无参数", url);
+                    log.debug("[PLUS]开始请求 => URL[{}],无参数", url);
                 }
             }
 
@@ -63,7 +63,7 @@ public class PlusWebInvokeTimeInterceptor extends AbsTLogWebHandlerMethodInterce
         if (TLogContext.enableInvokeTimePrint()) {
             StopWatch stopWatch = invokeTimeTL.get();
             stopWatch.stop();
-            log.info("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime());
+            log.debug("[PLUS]结束请求 => URL[{}],耗时:[{}]毫秒", request.getMethod() + " " + request.getRequestURI(), stopWatch.getTime());
             invokeTimeTL.remove();
         }
     }

+ 4 - 29
ruoyi-framework/src/main/java/com/ruoyi/framework/config/TLogConfig.java

@@ -1,13 +1,8 @@
 package com.ruoyi.framework.config;
 
-import com.yomahub.tlog.core.aop.AspectLogAop;
-import com.yomahub.tlog.spring.TLogPropertyInit;
-import com.yomahub.tlog.spring.TLogSpringAware;
-import com.yomahub.tlog.springboot.property.TLogProperty;
-import org.springframework.context.annotation.Bean;
+import com.yomahub.tlog.springboot.TLogWebAutoConfiguration;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.core.annotation.Order;
 
 /**
  * 整合 TLog 框架配置
@@ -15,29 +10,9 @@ import org.springframework.core.annotation.Order;
  * @author Lion Li
  * @since 3.3.0
  */
-@Order(-999)
 @Configuration
-@Import(TLogProperty.class)
+// 排除 web 自动配置 自定义实现
+@EnableAutoConfiguration(exclude = TLogWebAutoConfiguration.class)
 public class TLogConfig {
 
-    @Bean
-    public TLogPropertyInit tLogPropertyInit(TLogProperty tLogProperty) {
-        TLogPropertyInit tLogPropertyInit = new TLogPropertyInit();
-        tLogPropertyInit.setPattern(tLogProperty.getPattern());
-        tLogPropertyInit.setEnableInvokeTimePrint(tLogProperty.enableInvokeTimePrint());
-        tLogPropertyInit.setIdGenerator(tLogProperty.getIdGenerator());
-        tLogPropertyInit.setMdcEnable(tLogProperty.getMdcEnable());
-        return tLogPropertyInit;
-    }
-
-    @Bean
-    public TLogSpringAware tLogSpringAware(){
-        return new TLogSpringAware();
-    }
-
-    @Bean
-    public AspectLogAop aspectLogAop() {
-        return new AspectLogAop();
-    }
-
 }

+ 1 - 1
ruoyi-job/pom.xml

@@ -31,7 +31,7 @@
 
         <dependency>
             <groupId>com.yomahub</groupId>
-            <artifactId>tlog-xxl-job</artifactId>
+            <artifactId>tlog-xxljob-spring-boot-starter</artifactId>
         </dependency>
 
     </dependencies>

+ 1 - 7
ruoyi-job/src/main/java/com/ruoyi/job/config/XxlJobConfig.java

@@ -2,7 +2,6 @@ package com.ruoyi.job.config;
 
 import com.ruoyi.job.config.properties.XxlJobProperties;
 import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
-import com.yomahub.tlog.springboot.lifecircle.TLogXxljobEnhanceInit;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -40,9 +39,4 @@ public class XxlJobConfig {
         return xxlJobSpringExecutor;
     }
 
-    @Bean
-    public TLogXxljobEnhanceInit tLogXxljobEnhanceInit(){
-        return new TLogXxljobEnhanceInit();
-    }
-
-}
+}