public static Rule getRule(final String inequalitySymbol, final String value) {

    Level thisLevel;

    // if valid util.logging levels are used against events
    // with log4j levels, the
    // DEBUG level is used and an illegalargumentexception won't be generated

    // an illegalargumentexception is only generated
    // if the user types a level name
    // that doesn't exist as either a log4j or util.logging level name
    if (levelList.contains(value.toUpperCase())) {
      thisLevel = Level.parse(value.toUpperCase());
    } else {
      throw new IllegalArgumentException("Invalid level inequality rule - " + value + " is not a supported level");
    }

    if ("<".equals(inequalitySymbol)) {
      return new LessThanRule(thisLevel);
    }
    if (">".equals(inequalitySymbol)) {
      return new GreaterThanRule(thisLevel);
    }
    if ("<=".equals(inequalitySymbol)) {
      return new LessThanEqualsRule(thisLevel);
    }
    if (">=".equals(inequalitySymbol)) {
      return new GreaterThanEqualsRule(thisLevel);
    }

    return null;
  }
Create new rule.

@param inequalitySymbol inequality symbol.
@param value            Symbolic name of comparison level.
@return instance of AbstractRule.
olv-core/src/main/java/pl/otros/logview/accept/query/org/apache/log4j/rule/LevelInequalityRule.java