use of com.haulmont.cuba.core.sys.logging.AppenderThresholdNotSupported in project cuba by cuba-platform.
the class LogControlImpl method getAppenderThreshold.
@Override
public Level getAppenderThreshold(String appenderName) throws AppenderThresholdNotSupported {
for (Map.Entry<String, Appender> entry : getAllAppenders().entrySet()) {
if (entry.getKey().equals(appenderName)) {
Appender appender = entry.getValue();
for (Object filter : appender.getCopyOfAttachedFiltersList()) {
if (filter instanceof ThresholdFilter) {
try {
Field field = filter.getClass().getDeclaredField("level");
field.setAccessible(true);
return (Level) field.get(filter);
} catch (NoSuchFieldException | IllegalAccessException e) {
log.error("Error getting appender " + appenderName + " level", e);
throw new AppenderThresholdNotSupported(appenderName);
}
}
}
}
}
throw new AppenderThresholdNotSupported(appenderName);
}
Aggregations