com.github.javaclub.configcenter.client.util.LogUtil Maven / Gradle / Ivy
package com.github.javaclub.configcenter.client.util;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LogUtil {
private static final Logger logger = LoggerFactory.getLogger("cfg-client");
static {
try {
init();
} catch (Exception e) {
}
}
private static void init() throws IOException{
/*PatternLayout layout = new PatternLayout();
layout.setConversionPattern("%d %-5p [%c] %m%n");
DailyRollingFileAppender appender = new DailyRollingFileAppender();
appender.setLayout(layout);
appender.setName("cfg-client");
appender.setAppend(true);
appender.setFile(LocalFileUtils.getLocalLogDirPath() + "/cfg-client.log");
appender.setDatePattern("'.'yyyy-MM-dd'.log'");
appender.activateOptions();
logger.addAppender(appender);
logger.setAdditivity(false);
logger.setLevel(Level.INFO);*/
}
public static Logger getLogger(){
return logger;
}
}