I am using SLF4J and as per requirement i have to store the logs into the .log file. But when i run the program the log are not written into thelog file.
Class :
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestSLF4J {
// private static Logger _logger = LoggerFactory.getLogger(TestSLF4J.class);
private static Logger _logger = LoggerFactory.getLogger(TestSLF4J.class);
public static void main(String[] args) {
logger .debug("Sample debug message");
logger .info("Sample info message");
logger .warn("Sample warn message");
logger .error("Sample error message");
}
}
log4j.properties
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.maxFileSize=100KB
log4j.appender.file.maxBackupIndex=5
log4j.appender.file.File=C:/checkLog.log
log4j.appender.file.threshold=DEBUG
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=DEBUG,file
i can see info,warn,error on console but not debug value..!!
Can anyone help me store log into the checkLog.log file.??