Examples of activateOptions()


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

     
      RollingFileAppender fileAppender = new RollingFileAppender();
      fileAppender.setRollingPolicy(rollingPolicy);
      fileAppender.setTriggeringPolicy(rollingPolicy);
      fileAppender.setLayout(new PatternLayout("%d{ISO8601}[%-5p]: %m%n"));
      fileAppender.activateOptions();
     
      rootLogger.addAppender(fileAppender);
    }

    // Capture java.util.Logger
View Full Code Here

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

   * Prepares RollingFileAppender for use.
   */
  public void activateOptions() {
    SizeBasedTriggeringPolicy trigger = new SizeBasedTriggeringPolicy();
    trigger.setMaxFileSize(maxFileSize);
    trigger.activateOptions();
    rfa.setTriggeringPolicy(trigger);

    FixedWindowRollingPolicy rolling = new FixedWindowRollingPolicy();
    rolling.setMinIndex(1);
    rolling.setMaxIndex(maxBackupIndex);
View Full Code Here

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

Examples of org.apache.log4j.spi.Filter.activateOptions()

    public void test1() {
        LoggingEvent event = new LoggingEvent("org.apache.log4j.Logger",
                Logger.getLogger(DenyAllFilterTest.class),
                System.currentTimeMillis(), Level.INFO, "Hello, World", null);
        Filter filter = new DenyAllFilter();
        filter.activateOptions();
        assertEquals(Filter.DENY, filter.decide(event));
    }

}
View Full Code Here

Examples of org.apache.log4j.spi.OptionHandler.activateOptions()

    ReflectionException {

    if(operationName.equals("activateOptions") &&
                     appender instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) appender;
      oh.activateOptions();
      return "Options activated.";
    } else if (operationName.equals("setLayout")) {
      Layout layout = (Layout) OptionConverter.instantiateByClassName((String)
                      params[0],
                      Layout.class,
View Full Code Here

Examples of org.apache.log4j.spi.OptionHandler.activateOptions()

    ReflectionException {

    if(operationName.equals("activateOptions") &&
                     layout instanceof OptionHandler) {
      OptionHandler oh = (OptionHandler) layout;
      oh.activateOptions();
      return "Options activated.";
    }
    return null;
  }
View Full Code Here

Examples of org.apache.log4j.varia.LevelRangeFilter.activateOptions()

    // Filter for the statuses: we only want INFO messages
    LevelRangeFilter filter = new LevelRangeFilter();
    filter.setLevelMax(Level.INFO);
    filter.setLevelMin(Level.INFO);
    filter.setAcceptOnMatch(true);
    filter.activateOptions();

    TimeBasedRollingPolicy statusesRollingPolicy = new TimeBasedRollingPolicy();
    statusesRollingPolicy.setFileNamePattern("statuses.log" + HOUR_ROLL);
    statusesRollingPolicy.activateOptions();
View Full Code Here

Examples of org.apache.turbine.services.logging.jdbc.JDBCAppender.activateOptions()

         * implementation and the options without having to touch
         * anything else, but log4j doesn't really make it that easy.
         */
        //appender.setOption(JDBCAppender.LOGGER_OPTION, "pool:" + dbPool);
        appender.setLayout(layout);
        appender.activateOptions();
        logger.addAppender(appender);
    }

    /**
     * It performs action that are need for deterimne whether
View Full Code Here

Examples of org.jboss.logging.appender.DailyRollingFileAppender.activateOptions()

      appender.setFile(filename);
      appender.setAppend(appendToFile);
      appender.setDatePattern(rolloverPeriod.getRolloverFormat());
      appender.setLayout(new PatternLayout(patternLayout));
      appender.setThreshold(Level.INFO);
      appender.activateOptions();
      this.appender = appender;

      for (int i = 0; i < monitoredObjects.length; ++i)
      {
         monitoredObjects[i].getLogger().addAppender(appender);
View Full Code Here

Examples of org.jboss.logging.jdk.handlers.HandlerSkeleton.activateOptions()

               }
            }
         }
         PropertyEditors.mapJavaBeanProperties(appender, beanProps);
         if( handlerSkeleton != null )
            handlerSkeleton.activateOptions();
         return appender;
      }
      /* Yes, it's ugly, but all of these exceptions point to the same
      problem: we can't create an Handler
      */
 
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.