@Override
    public Result filter(LogEvent event) {
      boolean excludeMatches = (loggingMode == OperationLog.LoggingLevel.VERBOSE);

      String logLevel = event.getContextMap().get(LogUtils.OPERATIONLOG_LEVEL_KEY);
      logLevel = logLevel == null ? "" : logLevel;
      OperationLog.LoggingLevel currentLoggingMode = OperationLog.getLoggingLevel(logLevel);
      // If logging is disabled, deny everything.
      if (currentLoggingMode == OperationLog.LoggingLevel.NONE) {
        return Result.DENY;
      }
      // Look at the current session's setting
      // and set the pattern and excludeMatches accordingly.
      if (currentLoggingMode != loggingMode) {
        loggingMode = currentLoggingMode;
        excludeMatches = (loggingMode == OperationLog.LoggingLevel.VERBOSE);
        setCurrentNamePattern(loggingMode);
      }

      boolean isMatch = namePattern.matcher(event.getLoggerName()).matches();

      if (excludeMatches == isMatch) {
        // Deny if this is black-list filter (excludeMatches = true) and it
        // matched or if this is whitelist filter and it didn't match
        return Result.DENY;
      }

      return Result.NEUTRAL;
    }
A log filter that filters messages coming from the logger with the given names.
It be used as a white list filter or a black list filter.
We apply black list filter on the Loggers used by the log diversion stuff, so that
they don't generate more logs for themselves when they process logs.
White list filter is used for less verbose log collection
ql/src/java/org/apache/hadoop/hive/ql/log/LogDivertAppender.java