Package org.apache.log4j

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


      //if(l.isAttached(primary)) {
      logger.debug(
        "FB: Replacing [" + primary.getName() + "] by [" + backup.getName()
        + "] in logger [" + l.getName() + "].");
      l.removeAppender(primary);
      logger.debug(
        "FB: Adding appender [{}] to logger {}",  backup.getName(), l.getName());
      l.addAppender(backup);
    }
  }
View Full Code Here


    }

    @After
    public void tearDown() {
        Logger rootLogger = Logger.getRootLogger();
        rootLogger.removeAppender(appender);
    }

    @AfterClass
    public static void oneTimeTearDown() throws Exception {
        try {
View Full Code Here

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

   public void testSchemaValidity()
   {
View Full Code Here

      LogLog.debug("FB: Searching for ["+primary.getName()+"] in logger"
       +l.getName());
      //if(l.isAttached(primary)) {
      LogLog.debug("FB: Replacing ["+primary.getName()+"] by ["
       + backup.getName() + " in logger"+ l);
      l.removeAppender(primary);
      LogLog.debug("FB: Adding appender ["+backup.getName()+"] to logger "
       +  l.getName());
      l.addAppender(backup);
    }   
  }
View Full Code Here

      }

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

      log.removeAppender(listAppender);
    } finally {
      rpcClient.stop();
    }
  }
View Full Code Here

          Appender appender = logger.getAppender("ASYNC");
          if (null != appender) {
            log.info("Closing log-forwarding appender");
            appender.close();
            log.info("Removing log-forwarding appender");
            logger.removeAppender(appender);
            loggingDisabled = true;
          }
        }
      }
    } catch (IllegalArgumentException e) {
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

      }

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

      log.removeAppender(listAppender);
    } finally {
      rpcClient.stop();
    }
  }
View Full Code Here

      if (currentJob != this) {
          closeStats(logger, this);
      }
            if (tempAppender != null) {
                tempAppender.close();
                logger.removeAppender(tempAppender);
            }
    }

  }
View Full Code Here

    } finally {
      txn.close();
    }

    source.stop();
    logger.removeAppender(appender);

    Assert.assertNotNull(e);
    Assert.assertEquals(String.valueOf(SyslogAppender.LOG_FTP / 8),
        e.getHeaders().get(SyslogUtils.SYSLOG_FACILITY));
    Assert.assertArrayEquals(e.getBody(), "test flume syslog".getBytes());
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.