apache/beam · error · IllegalArgumentException

Unknown log level . Valid log levels are

Error message

Unknown log level ${level}. Valid log levels are ${validLevels}

What it means

LoggingTransformProvider's LoggingReadTransform.Level config maps configured level strings to java.util.logging Levels. getLogLevel throws IllegalArgumentException when getLevel() is non-null but not one of the supported keys (e.g. 'INFO', 'WARNING', 'SEVERE'), listing the valid levels in the message.

Solutions

  1. Use one of the valid level names listed in the error message (from SUPPORTED_LOG_LEVELS keySet)
  2. Check the provider docs/SUPPORTED_LOG_LEVELS map for exact accepted strings
  3. Omit the level entirely to get the default Level.INFO

Example fix

// before
level: WARN
// after
level: WARNING
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valid = Set.of("INFO","WARNING","SEVERE","CONFIG","FINE","FINER","FINEST","OFF","ALL");
if (level != null && !valid.contains(level)) throw new IllegalArgumentException("Invalid log level: " + level);

Prevention

When it happens

Trigger: Configuring the logging transform with a level string not present in SUPPORTED_LOG_LEVELS, e.g. 'debug', 'trace', or 'WARN' when only specific keys are supported.

Common situations: Using log4j/slf4j level names ('WARN', 'ERROR', 'DEBUG') instead of the java.util.logging names the provider supports; case/typo mistakes in pipeline YAML.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/c44035596234cd8d. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/providers/LoggingTransformProvider.java:105

    return Collections.singletonList(OUTPUT_ROWS_TAG);
  }

  @DefaultSchema(AutoValueSchema.class)
  @AutoValue
  public abstract static class Configuration {
    private static final Map<String, Level> SUPPORTED_LOG_LEVELS =
        ImmutableMap.of("ERROR", Level.ERROR, "INFO", Level.INFO, "DEBUG", Level.DEBUG);

    @Nullable
    public abstract String getLevel();

    public Level getLogLevel() {
      if (getLevel() == null) {
        return Level.INFO;
      } else if (SUPPORTED_LOG_LEVELS.containsKey(getLevel())) {
        return SUPPORTED_LOG_LEVELS.get(getLevel());
      } else {
        throw new IllegalArgumentException(
            "Unknown log level "
                + getLevel()
                + ". Valid log levels are "
                + ImmutableList.copyOf(SUPPORTED_LOG_LEVELS.keySet()));
      }
    }

    @Nullable
    public abstract String getPrefix();

    public String getNonNullPrefix() {
      String prefix = getPrefix();
      return prefix == null ? "" : prefix;
    }

    public static Builder builder() {
      return new AutoValue_LoggingTransformProvider_Configuration.Builder();
    }

View on GitHub (pinned to 12126d8942)