use of org.graylog2.rest.models.system.loggers.responses.SingleLoggerSummary in project graylog2-server by Graylog2.
the class LoggersResource method loggers.
@GET
@Timed
@ApiOperation(value = "List all loggers and their current levels")
@Produces(MediaType.APPLICATION_JSON)
public LoggersSummary loggers() {
final Collection<LoggerConfig> loggerConfigs = getLoggerConfigs();
final Map<String, SingleLoggerSummary> loggers = Maps.newHashMapWithExpectedSize(loggerConfigs.size());
for (LoggerConfig config : loggerConfigs) {
if (!isPermitted(RestPermissions.LOGGERS_READ, config.getName())) {
continue;
}
final Level level = config.getLevel();
loggers.put(config.getName(), SingleLoggerSummary.create(level.toString().toLowerCase(Locale.ENGLISH), level.intLevel()));
}
return LoggersSummary.create(loggers);
}
Aggregations