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; } }