Package org.apache.log4j.varia

Examples of org.apache.log4j.varia.LevelRangeFilter


        assertEquals("filterBased-test1.%i", rollingPolicy.getFileNamePattern());
        assertEquals(0, rollingPolicy.getMinIndex());
        assertTrue(rollingPolicy.isActivated());
        FilterBasedTriggeringPolicy triggeringPolicy =
                (FilterBasedTriggeringPolicy) rfa.getTriggeringPolicy();
        LevelRangeFilter filter = (LevelRangeFilter) triggeringPolicy.getFilter();
        assertTrue(Level.INFO.equals(filter.getLevelMin()));       
    }
View Full Code Here


      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
      levelFilter.setAcceptOnMatch(true);
      levelFilter.setLevelMin(base);
      levelFilter.setLevelMax(Level.FATAL);
    }
  }
View Full Code Here

      dateFilter = new LongRange(start.getTime(), end.getTime());
    }

    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
      levelFilter.setAcceptOnMatch(true);
      levelFilter.setLevelMin(base);
      levelFilter.setLevelMax(Level.FATAL);
    }
  }
View Full Code Here

      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
      levelFilter.setAcceptOnMatch(true);
      levelFilter.setLevelMin(base);
      levelFilter.setLevelMax(Level.FATAL);
    }
  }
View Full Code Here

        assertEquals("filterBased-test1.%i", rollingPolicy.getFileNamePattern());
        assertEquals(0, rollingPolicy.getMinIndex());
        assertTrue(rollingPolicy.isActivated());
        FilterBasedTriggeringPolicy triggeringPolicy =
                (FilterBasedTriggeringPolicy) rfa.getTriggeringPolicy();
        LevelRangeFilter filter = (LevelRangeFilter) triggeringPolicy.getFilter();
        assertTrue(Level.INFO.equals(filter.getLevelMin()));
        LogManager.resetConfiguration();
    }
View Full Code Here

      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
      levelFilter.setAcceptOnMatch(true);
      levelFilter.setLevelMin(base);
      levelFilter.setLevelMax(Level.FATAL);
    }
  }
View Full Code Here

      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
      levelFilter.setAcceptOnMatch(true);
      levelFilter.setLevelMin(base);
      levelFilter.setLevelMax(Level.FATAL);
    }
  }
View Full Code Here

      dateFilter = new LongRange(start.getTime(), end.getTime());
    }

    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
      levelFilter.setAcceptOnMatch(true);
      levelFilter.setLevelMin(base);
      levelFilter.setLevelMax(Level.FATAL);
    }
  }
View Full Code Here

   */
  public static void main(String[] args) {
        Logger root = Logger.getRootLogger();
        ConsoleAppender appender = new ConsoleAppender(new PatternLayout("%r [%t] %p %c %x - %m%n"));
        appender.setTarget("System.err");
        LevelRangeFilter filter = new LevelRangeFilter();
        filter.setLevelMin(Level.DEBUG);
        filter.setLevelMax(Level.DEBUG);
        appender.addFilter(filter);
        appender.activateOptions();
        root.addAppender(appender);
       
        appender = new ConsoleAppender(new PatternLayout());
        appender.setTarget("System.out");
        filter = new LevelRangeFilter();
        filter.setLevelMin(Level.INFO);
        filter.setLevelMax(Level.FATAL);
        appender.addFilter(filter);
        appender.activateOptions();
        root.addAppender(appender);

    ERSelenium.registerImportersExporters();
View Full Code Here

    PatternLayout layoutSimple = new PatternLayout();
    layoutSimple.setConversionPattern("%m%n");

    // 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

TOP

Related Classes of org.apache.log4j.varia.LevelRangeFilter

Copyright © 2018 www.massapicom. 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.