update tlog 1.3.4 => 1.3.5 启用 tlog 自动配置
| | |
| | | <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--> |
| | |
| | | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <artifactId>ruoyi-common</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.yomahub</groupId> |
| | | <artifactId>tlog-web-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | // 打印请求参数 |
| | | 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); |
| | | } |
| | | } |
| | | |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | 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 框架配置 |
| | |
| | | * @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(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | <dependency> |
| | | <groupId>com.yomahub</groupId> |
| | | <artifactId>tlog-xxl-job</artifactId> |
| | | <artifactId>tlog-xxljob-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | |
| | | |
| | | 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; |
| | |
| | | return xxlJobSpringExecutor; |
| | | } |
| | | |
| | | @Bean |
| | | public TLogXxljobEnhanceInit tLogXxljobEnhanceInit(){ |
| | | return new TLogXxljobEnhanceInit(); |
| | | } |
| | | |
| | | } |
| | | } |