Package org.apache.log4j.rolling

Examples of org.apache.log4j.rolling.TimeBasedRollingPolicy.activateOptions()


      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


      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

    if (inPattern) {
      pattern.append("}");
    }

    policy.setFileNamePattern(pattern.toString());
    policy.activateOptions();
    rfa.setTriggeringPolicy(policy);
    rfa.setRollingPolicy(policy);

    rfa.activateOptions();
  }
View Full Code Here

        TimeBasedRollingPolicy tbrp = new TimeBasedRollingPolicy();
        String pattern = fullFilePathAndPrefix + "-" + value + "-%d{"
            + datePattern + "}";

        tbrp.setFileNamePattern(pattern);
        tbrp.activateOptions();
        RollingFileAppender rfa = new RollingFileAppender();
        rfa.setRollingPolicy(tbrp);
        rfa.activateOptions();
        return rfa;
View Full Code Here

    filter.setAcceptOnMatch(true);
    filter.activateOptions();

    TimeBasedRollingPolicy statusesRollingPolicy = new TimeBasedRollingPolicy();
    statusesRollingPolicy.setFileNamePattern("statuses.log" + HOUR_ROLL);
    statusesRollingPolicy.activateOptions();

    RollingFileAppender statusesAppender = new RollingFileAppender();
    statusesAppender.setRollingPolicy(statusesRollingPolicy);
    statusesAppender.addFilter(filter);
    statusesAppender.setLayout(layoutSimple);
View Full Code Here

    statusesAppender.setLayout(layoutSimple);
    statusesAppender.activateOptions();

    TimeBasedRollingPolicy warningsRollingPolicy = new TimeBasedRollingPolicy();
    warningsRollingPolicy.setFileNamePattern("warnings.log" + HOUR_ROLL);
    warningsRollingPolicy.activateOptions();

    RollingFileAppender warningsAppender = new RollingFileAppender();
    warningsAppender.setRollingPolicy(statusesRollingPolicy);
    warningsAppender.setThreshold(Level.WARN);
    warningsAppender.setLayout(layoutStandard);
View Full Code Here

      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

      Logger rootLogger = Logger.getRootLogger();

      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("%-5p [%t]: %m%n"));
View Full Code Here

      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

    if (inPattern) {
      pattern.append("}");
    }

    policy.setFileNamePattern(pattern.toString());
    policy.activateOptions();
    rfa.setTriggeringPolicy(policy);
    rfa.setRollingPolicy(policy);

    rfa.activateOptions();
  }
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.