Package org.apache.log4j

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


        defaultLogger.addAppender(stdErrAppender);
    }

    protected void tearDown() throws Exception {
        Logger defaultLogger = Logger.getLogger(StopWatch.DEFAULT_LOGGER_NAME);
        defaultLogger.removeAppender("log4jStdErrAppender");
        super.tearDown();
    }

    protected LoggingStopWatch createStopWatch(String loggerName,
                                               String normalPriorityName,
View Full Code Here


    rootLogger.addAppender(this);
  }
 
  public void removeFromRootLogger() {
    Logger rootLogger = Logger.getRootLogger();
    rootLogger.removeAppender(this);
  }

  @Override
  public void close() {
  }
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

      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

      }

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

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

            ForceConnectorConfig config = createConfig();
            ForceServiceConnector connector = new ForceServiceConnector(config);
            connector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(mockAppender);
        }
       
        assertTrue(mockAppender.receivedLogLine(), "Did not receive expected log line: " + expectedLogLine);
    }
   
View Full Code Here

        try {
            ForceServiceConnector connector = new ForceServiceConnector("envvarconn");
            connector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(mockAppender);
        }
       
        assertTrue(mockAppender.receivedLogLine(), "Did not receive expected log line: " + expectedLogLine);
    }
   
View Full Code Here

            ForceServiceConnector connector = new ForceServiceConnector("testLogConnectorLoadFromJavaProp");
            connector.getConnection();
        } finally {
            System.clearProperty("force.testLogConnectorLoadFromJavaProp.url");
            logger.setLevel(oldLevel);
            logger.removeAppender(mockAppender);
        }
       
        assertTrue(mockAppender.receivedLogLine(), "Did not receive expected log line: " + expectedLogLine);
    }
   
View Full Code Here

        try {
            ForceServiceConnector connector = new ForceServiceConnector("funcconnuserinfo");
            connector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(mockAppender);
        }
       
        assertTrue(mockAppender.receivedLogLine(), "Did not receive expected log line: " + expectedLogLine);
    }
   
View Full Code Here

           
            ForceServiceConnector connector = new ForceServiceConnector(connectionName);
            connector.getConnection();
        } finally {
            logger.setLevel(oldLevel);
            logger.removeAppender(mockAppender);
        }
       
        assertTrue(mockAppender.receivedLogLine(), "Did not receive expected log line: " + expectedLogLine);
    }
   
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.