唐耀东
2022-10-12 d1bcbbefab4da603c275ed61d0018a46dbc67d1e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 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)
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();
    }
 
}