Examples of LogConfiguration


Examples of org.sonatype.nexus.log.LogConfiguration

  {
    makeRootLoggerLevelInfo();
  }

  protected void setRootLoggerLevel(final LoggerLevel value) throws IOException {
    final LogConfiguration oldConfiguration = logManager.getConfiguration();
    final DefaultLogConfiguration newConfiguration = new DefaultLogConfiguration();

    newConfiguration.setFileAppenderLocation(oldConfiguration.getFileAppenderLocation());
    newConfiguration.setFileAppenderPattern(oldConfiguration.getFileAppenderPattern());
    newConfiguration.setRootLoggerAppenders(oldConfiguration.getRootLoggerAppenders());
    newConfiguration.setRootLoggerLevel(value.name());
    logManager.setConfiguration(newConfiguration);
  }
View Full Code Here

Examples of org.sonatype.nexus.log.LogConfiguration

    }
  }

  @Test
  public void testLogConfig() throws Exception {
    LogConfiguration config1 = manager.getConfiguration();
    assertThat(config1.getRootLoggerLevel(), is("INFO"));

    DefaultLogConfiguration config2 = new DefaultLogConfiguration(config1);
    config2.setRootLoggerLevel("DEBUG");

    manager.setConfiguration(config2);

    LogConfiguration config3 = manager.getConfiguration();
    assertThat(config3.getRootLoggerLevel(), is("DEBUG"));

    // TODO check that is actually logging at debug level
  }
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.