karatelabs/karate · error · RuntimeException

'configure report = ' is no longer supported; use…

Error message

'configure report = { logLevel: ... }' is no longer supported; use 'configure logging = { report: "info" }' instead (see docs/MIGRATION_GUIDE.md#logging)

What it means

The legacy 'configure report = { logLevel: ... }' form has been removed in favor of the unified logging configuration. Karate detects the logLevel key inside a configure report map and throws a migration-error message pointing at docs/MIGRATION_GUIDE.md#logging.

Solutions

  1. Replace 'configure report = { logLevel: ... }' with 'configure logging = { report: "..." }'
  2. Follow docs/MIGRATION_GUIDE.md#logging for the full mapping of old report options to logging options
  3. Keep 'configure report = true/false' if you only need showLog/showAllSteps toggles — that form is still supported

Example fix

// before
* configure report = { logLevel: 'info' }
// after
* configure logging = { report: 'info' }
Defensive patterns

Strategy: validation

Validate before calling

// reject legacy logLevel before configuring
if (cfg.report && cfg.report.logLevel) { throw 'use configure logging = { report: ... } instead'; }

Type guard

function isModernLoggingCfg(cfg) { return !cfg || !cfg.report || !cfg.report.logLevel; }

Try / catch

try { karate.configure('report', map); } catch (RuntimeException e) { if (e.getMessage().contains('no longer supported')) { log.error('Migrate per docs/MIGRATION_GUIDE.md#logging'); } throw e; }

Prevention

When it happens

Trigger: A feature file or JS contains 'configure report = { logLevel: "info" }' (or similar map with a logLevel key). Boolean forms like 'configure report = false' still work; only the map-with-logLevel form throws.

Common situations: Projects upgraded from an older Karate version where per-report logLevel was valid; copied-from-old-docs karate-config.js; CI configs not updated during migration.

Understand the failure class

Background: "is deprecated and will be removed" — deprecation warnings for old API names, keywords, and options, and how to migrate before the removal release — this error's family across 29 libraries.

Related errors


AI-assisted analysis of karatelabs/karate@a22eb90246 (2026-09-12). Data as JSON: /api/errors/2f5952404531206f. Report an issue: GitHub.

Appendix: source

Thrown at karate-core/src/main/java/io/karatelabs/core/KarateConfig.java:606

        if (value instanceof Map<?, ?> map) {
            if (map.containsKey("interval")) {
                this.retry.put("interval", toInt(map.get("interval")));
            }
            if (map.containsKey("count")) {
                this.retry.put("count", toInt(map.get("count")));
            }
        }
    }

    private void configureReport(Object value) {
        if (value instanceof Boolean b) {
            this.report.put("showLog", b);
            this.report.put("showAllSteps", b);
            return;
        }
        if (value instanceof Map<?, ?> map) {
            if (map.containsKey("logLevel")) {
                throw new RuntimeException(
                        "'configure report = { logLevel: ... }' is no longer supported; use "
                                + "'configure logging = { report: \"info\" }' instead "
                                + "(see docs/MIGRATION_GUIDE.md#logging)");
            }
            if (map.containsKey("showLog")) {
                this.report.put("showLog", toBoolean(map.get("showLog")));
            }
            if (map.containsKey("showAllSteps")) {
                this.report.put("showAllSteps", toBoolean(map.get("showAllSteps")));
            }
        }
    }

    @SuppressWarnings("unchecked")
    private void configureLogging(Object value) {
        if (!(value instanceof Map<?, ?> raw)) {
            throw new RuntimeException("configure 'logging' expects a map, got: "
                    + (value == null ? "null" : value.getClass().getName()));

View on GitHub (pinned to a22eb90246)