Examples of TimeBasedRollingPolicy


Examples of org.apache.log4j.rolling.TimeBasedRollingPolicy

    {
      Logger rootLogger = Logger.getRootLogger();
     
      rootLogger.setLevel(Level.INFO);

      TimeBasedRollingPolicy rollingPolicy = new TimeBasedRollingPolicy();
      File logDir = new File(gs.getAtlasDir(), "logs");
      rollingPolicy.setFileNamePattern(logDir.getAbsolutePath()+"/nunaliit.%d.gz");
      rollingPolicy.activateOptions();
     
      RollingFileAppender fileAppender = new RollingFileAppender();
      fileAppender.setRollingPolicy(rollingPolicy);
      fileAppender.setTriggeringPolicy(rollingPolicy);
      fileAppender.setLayout(new PatternLayout("%d{ISO8601}[%-5p]: %m%n"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.