Package org.sonatype.nexus.log

Examples of org.sonatype.nexus.log.LogConfiguration


    this.logManager = Preconditions.checkNotNull(logManager, "Managed LogManager instance cannot be null!");
  }

  @Override
  public String getRootLoggerLevel() throws IOException {
    final LogConfiguration logConfiguration = logManager.getConfiguration();
    return logConfiguration.getRootLoggerLevel();
  }
View Full Code Here


  {
    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

    }
  }

  @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

Related Classes of org.sonatype.nexus.log.LogConfiguration

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.