コード例 #1
0
  /** {@inheritDoc} */
  @Override
  protected void setUp() throws Exception {
    Logger root = Logger.getRootLogger();

    for (Enumeration appenders = root.getAllAppenders(); appenders.hasMoreElements(); ) {
      if (appenders.nextElement() instanceof GridLog4jRollingFileAppender) return;
    }

    appender = createAppender();

    root.addAppender(appender);
  }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  public void tearDown() {
    if (appender != null) {
      Logger.getRootLogger().removeAppender(GridLog4jRollingFileAppender.class.getSimpleName());

      GridLog4jLogger.removeAppender(appender);
    }
  }