Package org.apache.log4j

Examples of org.apache.log4j.VectorAppender


     * Tests that reset="true" on log4j:configuration element resets
     * repository before configuration.
     * @throws Exception thrown on error.
     */
  public void testReset() throws Exception {
      VectorAppender appender = new VectorAppender();
      appender.setName("V1");
      Logger.getRootLogger().addAppender(appender);
      DOMConfigurator.configure("input/xml/testReset.xml");
      assertNull(Logger.getRootLogger().getAppender("V1"));
  }
View Full Code Here


     */
    public LogCapture(final Level level) {
        this.level = level;

        Logger root = Logger.getRootLogger();
        appender = new VectorAppender();
        root.addAppender(appender);
    }
View Full Code Here

    // Write out just one log message
    Logger out = lrWrite.getLogger("testSingleOutput.out");
    out.debug("some message"+startTime);

    VectorAppender witnessAppender = (VectorAppender) lrWrite.getRootLogger().getAppender("VECTOR");
    witnessEvents = witnessAppender.getVector();
    assertEquals(1, witnessEvents.size());   

    // We have to close all appenders before starting to read
    lrWrite.shutdown();
View Full Code Here

    // the db
    MDC.remove("key1");
    MDC.remove("key2");
    MDC.remove("key3");

    VectorAppender witnessAppender = (VectorAppender) lrWrite.getRootLogger().getAppender("VECTOR");
    witnessEvents = witnessAppender.getVector();
    assertEquals(2, witnessEvents.size());   

    // We have to close all appenders just before starting to read
    lrWrite.shutdown();
   
View Full Code Here

    jc2.doConfigure(is, lrRead);
    is.close();
   
    // wait a little to allow events to be read
    try { Thread.sleep(3100); } catch(Exception e) {}
    VectorAppender va = (VectorAppender) lrRead.getRootLogger().getAppender("VECTOR");
    Vector returnedEvents = getRelevantEventsFromVA(va, startTime);
   
    compareEvents(witnessEvents, returnedEvents);
   
  }
View Full Code Here

     * Tests that reset="true" on log4j:configuration element resets
     * repository before configuration.
     * @throws Exception thrown on error.
     */
  public void testReset() throws Exception {
      VectorAppender appender = new VectorAppender();
      appender.setName("V1");
      Logger.getRootLogger().addAppender(appender);
      DOMConfigurator.configure("input/xml/testReset.xml");
      assertNull(Logger.getRootLogger().getAppender("V1"));
  }
View Full Code Here

TOP

Related Classes of org.apache.log4j.VectorAppender

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.