From 8f8e796c777577dcef888b94603ed93bebcc1ee6 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 06 十二月 2021 14:36:38 +0800
Subject: [PATCH] update tlog 1.3.4 => 1.3.5 启用 tlog 自动配置
---
ruoyi-job/src/main/java/com/ruoyi/job/config/XxlJobConfig.java | 8 ---
ruoyi-framework/pom.xml | 5 ++
ruoyi-framework/src/main/java/com/ruoyi/framework/config/TLogConfig.java | 33 ++--------------
ruoyi-job/pom.xml | 2
pom.xml | 22 +---------
ruoyi-common/pom.xml | 10 -----
ruoyi-framework/src/main/java/com/ruoyi/framework/Interceptor/PlusWebInvokeTimeInterceptor.java | 8 ++--
7 files changed, 18 insertions(+), 70 deletions(-)
diff --git a/pom.xml b/pom.xml
index 1328919..0dd48a3 100644
--- a/pom.xml
+++ b/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>
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
index c153cd5..2111510 100644
--- a/ruoyi-common/pom.xml
+++ b/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>
diff --git a/ruoyi-framework/pom.xml b/ruoyi-framework/pom.xml
index d5466af..a368e5e 100644
--- a/ruoyi-framework/pom.xml
+++ b/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>
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/Interceptor/PlusWebInvokeTimeInterceptor.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/Interceptor/PlusWebInvokeTimeInterceptor.java
index e2120bf..a82fb65 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/Interceptor/PlusWebInvokeTimeInterceptor.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/Interceptor/PlusWebInvokeTimeInterceptor.java
@@ -35,14 +35,14 @@
// 鎵撳嵃璇锋眰鍙傛暟
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 @@
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();
}
}
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TLogConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TLogConfig.java
index c1665d9..5ae55ad 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/TLogConfig.java
+++ b/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 @@
* @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();
- }
}
diff --git a/ruoyi-job/pom.xml b/ruoyi-job/pom.xml
index a87b3ef..3c13d35 100644
--- a/ruoyi-job/pom.xml
+++ b/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>
diff --git a/ruoyi-job/src/main/java/com/ruoyi/job/config/XxlJobConfig.java b/ruoyi-job/src/main/java/com/ruoyi/job/config/XxlJobConfig.java
index 2df063e..e051ff0 100644
--- a/ruoyi-job/src/main/java/com/ruoyi/job/config/XxlJobConfig.java
+++ b/ruoyi-job/src/main/java/com/ruoyi/job/config/XxlJobConfig.java
@@ -2,7 +2,6 @@
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 @@
return xxlJobSpringExecutor;
}
- @Bean
- public TLogXxljobEnhanceInit tLogXxljobEnhanceInit(){
- return new TLogXxljobEnhanceInit();
- }
-
-}
\ No newline at end of file
+}
--
Gitblit v1.9.3