mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update tlog 1.3.4 => 1.3.5 启用 tlog 自动配置
This commit is contained in:
@ -63,6 +63,11 @@
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>tlog-web-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user