疯狂的狮子li
2022-09-13 adfae03953e5929f2924d4b9e30ecb7fe15faa37
ruoyi-framework/src/main/java/com/ruoyi/framework/config/TLogConfig.java
@@ -1,14 +1,8 @@
package com.ruoyi.framework.config;
import com.yomahub.tlog.core.aop.AspectLogAop;
import com.yomahub.tlog.feign.filter.TLogFeignFilter;
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 框架配置
@@ -16,34 +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();
    }
    @Bean
    public TLogFeignFilter tLogFeignFilter() {
        return new TLogFeignFilter();
    }
}