Package org.springside.modules.log

Examples of org.springside.modules.log.Log4jMBean


public class Log4jMBeanTest {

  @Test
  public void testRootLoggerLevel() {
    Log4jMBean mbean = new Log4jMBean();

    String orgLevel = mbean.getRootLoggerLevel();
    Logger.getRootLogger().setLevel(Level.FATAL);

    assertEquals("FATAL", mbean.getRootLoggerLevel());

    mbean.setRootLoggerLevel("TRACE");
    assertEquals("TRACE", mbean.getRootLoggerLevel());

    mbean.setRootLoggerLevel(orgLevel);
  }
View Full Code Here


  @Test
  public void testLoggerLevel() {

    String loggerName = "org.springside.modules";
    Log4jMBean mbean = new Log4jMBean();
    String orgLevel = mbean.getLoggerLevel(loggerName);

    Logger.getLogger(loggerName).setLevel(Level.FATAL);
    assertEquals("FATAL", mbean.getLoggerLevel(loggerName));

    mbean.setLoggerLevel(loggerName, "TRACE");
    assertEquals("TRACE", mbean.getLoggerLevel(loggerName));

    mbean.setLoggerLevel(loggerName, "WRONG_LEVEL_NAME");
    assertEquals("DEBUG", mbean.getLoggerLevel(loggerName));

    mbean.setLoggerLevel(loggerName, orgLevel);
  }
View Full Code Here

TOP

Related Classes of org.springside.modules.log.Log4jMBean

Copyright © 2018 www.massapicom. 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.