Useing Log4J
log4j.rootLogger = DEBUG,CONSOLE, DailyRolling_FILE,ROLLING_FILE log4j.addivity.org.apache=true ################### # Console Appender ################### log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.Threshold=INFO log4j.appender.CONSOLE.Target=System.out log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n log4j.appender.DailyRolling_FILE=org.apache.log4j.DailyRollingFileAppender log4j.appender.DailyRolling_FILE.File=D:\\del\\log.log log4j.appender.DailyRolling_FILE.Append = true log4j.appender.DailyRolling_FILE.DatePattern = yyyy-MM-dd'.' log4j.appender.DailyRolling_FILE.layout=org.apache.log4j.PatternLayout log4j.appender.DailyRolling_FILE.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender log4j.appender.ROLLING_FILE.Threshold=info,DEBUG,ERROR log4j.appender.ROLLING_FILE.File=D:\\del\\Rolling.log log4j.appender.ROLLING_FILE.Append=true log4j.appender.ROLLING_FILE.MaxFileSize=20MB log4j.appender.ROLLING_FILE.MaxBackupIndex=10 log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout log4j.appender.ROLLING_FILE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n Logger logger=Logger.getLogger(Log.class); logger.info("---------------------info"+i); logger.error("---------------------error"+i); logger.debug("----debug----"+i);
相关推荐
chw0 2020-11-04
大唐帝国前营 2020-08-18
sdaq 2020-07-26
MrLiar 2020-07-07
sdaq 2020-06-16
CXC0 2020-06-14
丨Fanny丨Cri 2020-06-13
CXC0 2020-06-08
dongxurr 2020-06-07
sdaq 2020-06-06
MrLiar 2020-06-04
丨Fanny丨Cri 2020-06-03
MrLiar 2020-05-25
丨Fanny丨Cri 2020-05-17
MrLiar 2020-05-14
MrLiar 2020-05-12
sdaq 2020-05-11