Package org.slf4j.impl

Source Code of org.slf4j.impl.RecursiveInitializationTest

package org.slf4j.impl;

import java.util.Random;

import junit.framework.TestCase;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RecursiveInitializationTest extends TestCase {

  // value of LogManager.DEFAULT_CONFIGURATION_KEY;
  static String CONFIG_FILE_KEY = "log4j.configuration";

  int diff = new Random().nextInt(10000);
 
  protected void setUp() throws Exception {
    System.setProperty(CONFIG_FILE_KEY, "recursiveInit.properties");
    super.setUp();
  }

  protected void tearDown() throws Exception {
    System.clearProperty(CONFIG_FILE_KEY);
    super.tearDown();
  }

  public void testLog4j() {
    Logger logger = LoggerFactory.getLogger("x"+diff);
    System.out.println("logger class="+logger.getClass().getName());
    logger.info("hello");
  }

}
TOP

Related Classes of org.slf4j.impl.RecursiveInitializationTest

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.