karatelabs/karate · warning

configure ' ' is deprecated; use 'configure logging = }

Error message

configure '{}' is deprecated; use 'configure logging = {{ pretty: true|false }}'

What it means

Karate v2 removed the v1 `configure logPrettyRequest` / `configure logPrettyResponse` options. Setting either is now a no-op that logs this deprecation warning pointing to the unified `configure logging = { pretty: true|false }` syntax. Scripts still run, but the old keys no longer change behavior.

Solutions

  1. Replace both keys with `configure logging = { pretty: true }` (or false) in the feature/config
  2. Search the codebase (karate-config.js, *.feature) for logPrettyRequest/logPrettyResponse and update all occurrences
  3. Verify pretty logging works by checking request/response output after the change
  4. Update internal docs/templates to the v2 logging syntax

Example fix

// before
* configure logPrettyRequest = true
* configure logPrettyResponse = true
// after
* configure logging = { pretty: true }
Defensive patterns

Strategy: validation

Validate before calling

grep -rnE 'configure\s+(logPrettyRequest|logPrettyResponse)' karate-config.js features/ && echo 'deprecated configure keys found'

Prevention

When it happens

Trigger: A feature file or JS bootstrap containing `configure logPrettyRequest = true` or `configure logPrettyResponse = false`, typically carried over from a Karate v1 project after upgrading.

Common situations: v1→v2 migration where karate-config.js or feature setup blocks were copied unchanged; team style guides referencing old docs; snippets from outdated tutorials/Stack Overflow answers.

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/4d1d5a0512df0c36. Report an issue: GitHub.

Appendix: source

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

            }
            case "afterScenarioOutline" -> {
                this.afterScenarioOutline = value;
            }
            case "afterFeature" -> {
                this.afterFeature = value;
            }
            case "onStepFailure" -> {
                this.onStepFailure = value;
            }

            // Driver configuration
            case "driver" -> {
                this.driverConfig = value;
            }

            // Deprecated v1 options - no-op with one-line migration hint
            case "logPrettyRequest", "logPrettyResponse" -> {
                logger.warn("configure '{}' is deprecated; use 'configure logging = {{ pretty: true|false }}'", key);
            }
            case "printEnabled" -> {
                logger.warn("configure 'printEnabled' is deprecated; print/karate.log go to the 'karate.scenario' "
                        + "SLF4J category - set its level to WARN in logback.xml to keep them off the console, "
                        + "or 'configure logging = {{ console: \"warn\" }}' to quiet all karate console output");
            }
            case "lowerCaseResponseHeaders" -> {
                logger.warn("configure 'lowerCaseResponseHeaders' is deprecated; "
                        + "'match header X' is already case-insensitive and 'karate.lowerCase(responseHeaders)' "
                        + "covers direct map access");
            }
            case "logModifier" -> {
                logger.warn("configure 'logModifier' is removed; "
                        + "use the declarative form: 'configure logging = {{ mask: {{ headers: [...], jsonPaths: [...], patterns: [...] }} }}'");
            }

            // No channel-type cases: channels (grpc, kafka, …) are configured via their rich
            // JS object — karate.channel('kafka') / the boot.ext('kafka') object — not via global

View on GitHub (pinned to a22eb90246)