karatelabs/karate · warning

configure 'printEnabled' is deprecated; print/karate.log go…

Error message

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

What it means

Karate v2 removed the `configure printEnabled` option; print() and karate.log output now go to the 'karate.scenario' SLF4J category, so console noise is controlled via logback levels instead. Setting printEnabled is a no-op that logs this deprecation warning with migration instructions.

Solutions

  1. Remove `configure printEnabled` and set the 'karate.scenario' logger level to WARN in logback.xml to hide print/karate.log from the console
  2. Alternatively use `configure logging = { console: "warn" }` to quiet all Karate console output
  3. Grep karate-config.js and feature files for printEnabled and delete the lines
  4. Re-run and confirm console output level matches expectations

Example fix

// before
* configure printEnabled = false
// after (logback.xml)
<logger name="karate.scenario" level="WARN"/>
Defensive patterns

Strategy: validation

Validate before calling

grep -rn 'configure printEnabled' karate-config.js features/ && echo 'deprecated configure key found'

Prevention

When it happens

Trigger: A feature file or karate-config.js containing `configure printEnabled = false` (or true) — usually to silence print output — after upgrading from Karate v1.

Common situations: v1→v2 migration of karate-config.js; CI setups that relied on printEnabled to quiet logs; copied config snippets from older project templates.

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

Appendix: source

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

            }
            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
            // 'configure <type>'. 'configure' stays strict so key typos fail loudly.
            default -> throw new RuntimeException("unexpected 'configure' key: '" + key + "'");
        }

View on GitHub (pinned to a22eb90246)