public static AlertLevel fromLevel(final Level level) {
    if (level == Level.FATAL) {
      return SEVERE;
    } else if (level == Level.ERROR) {
      return ERROR;
    } else if (level == Level.WARN) {
      return WARNING;
    } else if (level == Level.OFF) {
      return NONE;
    }

    throw new IllegalArgumentException("No matching AlertLevel for Log4J2 Level " + level + ".");
  }
Converts from a Log4J2 {@code Level} to an {@link AlertLevel}.

@throws IllegalArgumentException if there is no matching Alert
geode-core/src/main/java/org/apache/geode/alerting/internal/log4j/AlertLevelConverter.java