use of tech.pegasys.teku.infrastructure.logging.LoggingConfig in project teku by ConsenSys.
the class BeaconNodeCommand method startLogging.
private void startLogging() {
LoggingConfig loggingConfig = buildLoggingConfig(dataOptions.getDataPath(), LOG_FILE_PREFIX);
loggingConfigurator.startLogging(loggingConfig);
// jupnp logs a lot of context to level WARN, and it is quite verbose.
LoggingConfigurator.setAllLevelsSilently("org.jupnp", Level.ERROR);
}
use of tech.pegasys.teku.infrastructure.logging.LoggingConfig in project teku by ConsenSys.
the class LoggingOptionsTest method loggingOptions_shouldReadFromConfigurationFile.
@Test
public void loggingOptions_shouldReadFromConfigurationFile() {
final LoggingConfig loggingConfig = getLoggingConfigFromFile("loggingOptions_config.yaml");
assertThat(loggingConfig.getDestination()).isEqualTo(LoggingDestination.FILE);
assertThat(loggingConfig.isColorEnabled()).isFalse();
assertThat(loggingConfig.isIncludeEventsEnabled()).isFalse();
assertThat(loggingConfig.getLogFile()).isEqualTo(VersionProvider.defaultStoragePath() + SLASH + "logs" + SLASH + "a.log");
assertThat(loggingConfig.getLogFileNamePattern()).isEqualTo(VersionProvider.defaultStoragePath() + SLASH + "logs" + SLASH + "a%d.log");
}
use of tech.pegasys.teku.infrastructure.logging.LoggingConfig in project teku by ConsenSys.
the class LoggingOptionsTest method shouldSetLogFileRelativeToSetDataDirectory.
@Test
public void shouldSetLogFileRelativeToSetDataDirectory() {
final String[] args = { "--data-path", OSUtils.toOSPath("/yo") };
final LoggingConfig config = getLoggingConfigurationFromArguments(args);
assertThat(config.getLogFile()).isEqualTo(OSUtils.toOSPath("/yo/logs/teku.log"));
}
use of tech.pegasys.teku.infrastructure.logging.LoggingConfig in project teku by ConsenSys.
the class LoggingOptionsTest method shouldSetLogPatternToDefaultDataDirectory.
@Test
public void shouldSetLogPatternToDefaultDataDirectory() {
final String[] args = { "--data-path", OSUtils.toOSPath("/my/path") };
final LoggingConfig config = getLoggingConfigurationFromArguments(args);
assertThat(config.getLogFileNamePattern()).isEqualTo(OSUtils.toOSPath("/my/path/logs/" + LOG_PATTERN));
}
use of tech.pegasys.teku.infrastructure.logging.LoggingConfig in project teku by ConsenSys.
the class LoggingOptionsTest method shouldSetLogPatternOnWithoutPath.
@Test
public void shouldSetLogPatternOnWithoutPath() {
final String[] args = { "--log-file-name-pattern", "%d.log" };
final String expectedLogPatternPath = StringUtils.joinWith(System.getProperty("file.separator"), VersionProvider.defaultStoragePath(), "logs", "%d.log");
final LoggingConfig config = getLoggingConfigurationFromArguments(args);
assertThat(config.getLogFileNamePattern()).isEqualTo(expectedLogPatternPath);
}
Aggregations