Package org.apache.log4j

Examples of org.apache.log4j.Logger.removeAppender()


      ctx.getBean("foo");

      ctx.close();

    } finally {
      logger.removeAppender(appender);
    }
  }

  private Appender nothingLoggedAppender() {
    Appender appender = Mockito.mock(Appender.class);
View Full Code Here


   @AfterMethod
   public void tearDownTest() {
      Logger log4jLogger = Logger.getRootLogger();
      log4jLogger.setLevel(oldLevel);
      log4jLogger.removeAppender(appender);
      appender.close();
   }


   public void testConfigWarnings() throws Exception {
View Full Code Here

    assertFalse(listAppender.getMessages().isEmpty());
    assertTrue(listAppender.getMessages().get(0).startsWith(
        "Too many delayed calls"));

    log.removeAppender(listAppender);
  }

  public interface TestRpc extends VersionedProtocol {
    public static final long VERSION = 1L;
    int test(boolean delay);
View Full Code Here

        "Could not find appender " + Constants.TEMP_CONSOLE_APPENDER_NAME;
      errorList.add(new ErrorItem(errMsg));
      return;
    }
    consoleAppender.close();
    ll.removeAppender(consoleAppender);
  }
 
  /**
   * Dump any errors on System.out.
   */
 
View Full Code Here

    assertFalse(listAppender.getMessages().isEmpty());
    assertTrue(listAppender.getMessages().get(0).startsWith(
        "Too many delayed calls"));

    log.removeAppender(listAppender);
  }

  public interface TestRpc extends VersionedProtocol {
    public static final long VERSION = 1L;
    int test(boolean delay);
View Full Code Here

      catch(Exception e) { return; }
      if(i == -1) break;
      if(i == 'q') break;
      if(i == 'r') {
  System.out.println("Removing appender S");
  root.removeAppender("S");
      }
    }
  }

  static
View Full Code Here

    Logger qlogger = Logger.getLogger(Job.class);
    qlogger.addAppender(appender);

    job.monitorAndPrintJob();

    qlogger.removeAppender(appender);
    LineNumberReader r = new LineNumberReader(new StringReader(os.toString()));
    String line;
    boolean foundHundred = false;
    boolean foundComplete = false;
    String match_1 = "map 100% reduce 100%";
View Full Code Here

                    CreateMode.PERSISTENT);

            // resume poor fellow
            qu.getPeer(1).peer.resume();
        } finally {
            zlogger.removeAppender(appender);
        }

        os.close();
        LineNumberReader r = new LineNumberReader(new StringReader(os
                .toString()));
View Full Code Here

            Assert.assertTrue("waiting for server 1 down",
                    ClientBase.waitForServerDown("127.0.0.1:" + CLIENT_PORT_QP1,
                            ClientBase.CONNECTION_TIMEOUT));

        } finally {
            qlogger.removeAppender(appender);
        }

        LineNumberReader r = new LineNumberReader(new StringReader(os.toString()));
        String line;
        boolean found = false;
View Full Code Here

            Assert.assertTrue("waiting for server 3 down",
                    ClientBase.waitForServerDown("127.0.0.1:" + CLIENT_PORT_QP3,
                            ClientBase.CONNECTION_TIMEOUT));

        } finally {
            qlogger.removeAppender(appender);
        }

        LineNumberReader r = new LineNumberReader(new StringReader(os.toString()));
        String line;
        boolean warningPresent = false;
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.