代码中配置log4j 参数


              
              PatternLayout pl = new PatternLayout("%d %-5p %c - %m%n");

	      RollingFileAppender rfa = new RollingFileAppender(pl,"/home/lein/workspace/test/xxx.log");
	      rfa.setMaximumFileSize(100);
	      rfa.setMaxBackupIndex(10);
	      
	      ConsoleAppender ca = new ConsoleAppender(pl);
	            
	            
	      BasicConfigurator.configure(ca);
	      Logger.getRootLogger().addAppender(rfa);




你可能感兴趣的:(代码中配置log4j 参数)