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);