1
jyy
2021-07-11 2957623eed5fabb83b8f64dc106ec9b6d129c09d
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
package com.matrix.core.tools;
 
import org.apache.log4j.DailyRollingFileAppender;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
 
/**
 * 日志记录适配器
 * 
 * @author JIANGYOUYAO
 * @email 935090232@qq.com
 * @date 2017年11月27日
 */
@Component
public class MatrixFileAppender extends DailyRollingFileAppender {
 
    @Value("${log_path}")
    String log_path;
 
    /**
     * 设置相对服务器的日志路径
     */
    @Override
    public void setFile(String file) {
        String val = file.trim();
        fileName = log_path + val;
    }
}