use of org.slf4j.event.Level in project open-kilda by telstra.
the class KafkaLoggerTopology method makeStormConfig.
@Override
protected Config makeStormConfig() {
Config config = super.makeStormConfig();
Level level = this.config.getLoggerLevel();
config.setDebug(level == Level.DEBUG || level == Level.TRACE);
return config;
}
use of org.slf4j.event.Level in project dolphin-platform by canoo.
the class LogFilterController method getCurrentRequest.
public LoggerSearchRequest getCurrentRequest() {
final ZonedDateTime start = model.getStartDate();
final ZonedDateTime end = model.getEndDateTime();
final Set<Level> levels = Collections.unmodifiableSet(new HashSet<>(model.getLevel()));
final int maxResults = Optional.ofNullable(model.maxResultsProperty().get()).orElse(-1);
return new LoggerSearchRequest(start, end, levels, maxResults);
}
use of org.slf4j.event.Level in project dolphin-platform by canoo.
the class DolphinLoggerFactory method configure.
public synchronized void configure(final DolphinLoggerConfiguration configuration) {
Assert.requireNonNull(configuration, "configuration");
bridges.clear();
final Iterator<DolphinLoggerBridgeFactory> iterator = ServiceLoader.load(DolphinLoggerBridgeFactory.class).iterator();
while (iterator.hasNext()) {
final DolphinLoggerBridge bridge = iterator.next().create(configuration);
if (bridge != null) {
bridges.add(bridge);
}
}
markers.clear();
for (final DolphinLogger logger : loggerMap.values()) {
logger.updateBridges(Collections.unmodifiableList(bridges));
final Level level = configuration.getLevelFor(logger.getName());
logger.setLevel(level);
}
this.configuration = configuration;
configured.set(true);
}
use of org.slf4j.event.Level in project dolphin-platform by canoo.
the class DolphinLoggerFactory method getLogger.
@Override
public synchronized Logger getLogger(final String name) {
if (!configured.get()) {
configure(new DolphinLoggerConfiguration());
}
final DolphinLogger logger = this.loggerMap.get(name);
if (logger != null) {
return logger;
} else {
final Level loggerLevel = configuration.getLevelFor(name);
final DolphinLogger newInstance = new DolphinLogger(this, name, bridges, loggerLevel);
final DolphinLogger oldInstance = this.loggerMap.putIfAbsent(name, newInstance);
return oldInstance == null ? newInstance : oldInstance;
}
}
use of org.slf4j.event.Level in project dolphin-platform by canoo.
the class LogFilterView method updateItem.
private void updateItem() {
// TODO: Handle null value
final LocalDate startDate = Optional.ofNullable(startDatePicker.getValue()).orElse(LocalDate.now());
final LocalTime startTime = LocalTime.of(startHourSpinner.getValue(), startMinuteSpinner.getValue(), startSecondSpinner.getValue(), startMilliSpinner.getValue() * 1_000_000);
final ZonedDateTime startDateTime = ZonedDateTime.of(LocalDateTime.of(startDate, startTime), ZoneId.systemDefault());
final LocalDate endDate = Optional.ofNullable(endDatePicker.getValue()).orElse(LocalDate.now());
final LocalTime endTime = LocalTime.of(endHourSpinner.getValue(), endMinuteSpinner.getValue(), endSecondSpinner.getValue(), endMilliSpinner.getValue() * 1_000_000);
final ZonedDateTime endDateTime = ZonedDateTime.of(LocalDateTime.of(endDate, endTime), ZoneId.systemDefault());
final Set<Level> selectedLevels = Optional.ofNullable(levelComboBox.getSelectionModel().getSelectedItem()).map(l -> Collections.singleton(l)).orElse(Collections.emptySet());
final int maxResults = maxResultsSpinner.getValue();
final LoggerSearchRequest newRequest = new LoggerSearchRequest(startDateTime, endDateTime, selectedLevels, maxResults);
loggerSearchRequest.setValue(newRequest);
}
Aggregations