public class LoggerHelp {
public static Logger getInstance(String name){
String path =log4jpath;
PropertyConfigurator.configure(path);
return Logger.getLogger(name);
}
}
log4j.logger.aaa= ALL, aaa,Console
log4j.appender.aaa=org.apache.log4j.RollingFileAppender
log4j.appender.aaa.File=D://aaa.log
log4j.appender.aaa.Append=true
log4j.appender.aaa.Threshold=DEBUG
log4j.appender.aaa.MaxFileSize=2048KB
log4j.appender.aaa.layout=org.apache.log4j.PatternLayout
log4j.appender.aaa.MaxBackupIndex=15
log4j.appender.aaa.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss S} %F %p [%c] - %m%n
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.Target=System.out
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d %p [%c] - %m%n