{"record":{"id":"4d1d5a0512df0c36","repo":"karatelabs/karate","slug":"configure-is-deprecated-use-configure-logging-pretty-true","errorCode":null,"errorMessage":"configure '{}' is deprecated; use 'configure logging = {{ pretty: true|false }}'","messagePattern":"configure '(.+?)' is deprecated; use 'configure logging = (.+?)\\}'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/core/KarateConfig.java","lineNumber":438,"sourceCode":"            }\n            case \"afterScenarioOutline\" -> {\n                this.afterScenarioOutline = value;\n            }\n            case \"afterFeature\" -> {\n                this.afterFeature = value;\n            }\n            case \"onStepFailure\" -> {\n                this.onStepFailure = value;\n            }\n\n            // Driver configuration\n            case \"driver\" -> {\n                this.driverConfig = value;\n            }\n\n            // Deprecated v1 options - no-op with one-line migration hint\n            case \"logPrettyRequest\", \"logPrettyResponse\" -> {\n                logger.warn(\"configure '{}' is deprecated; use 'configure logging = {{ pretty: true|false }}'\", key);\n            }\n            case \"printEnabled\" -> {\n                logger.warn(\"configure 'printEnabled' is deprecated; print/karate.log go to the 'karate.scenario' \"\n                        + \"SLF4J category - set its level to WARN in logback.xml to keep them off the console, \"\n                        + \"or 'configure logging = {{ console: \\\"warn\\\" }}' to quiet all karate console output\");\n            }\n            case \"lowerCaseResponseHeaders\" -> {\n                logger.warn(\"configure 'lowerCaseResponseHeaders' is deprecated; \"\n                        + \"'match header X' is already case-insensitive and 'karate.lowerCase(responseHeaders)' \"\n                        + \"covers direct map access\");\n            }\n            case \"logModifier\" -> {\n                logger.warn(\"configure 'logModifier' is removed; \"\n                        + \"use the declarative form: 'configure logging = {{ mask: {{ headers: [...], jsonPaths: [...], patterns: [...] }} }}'\");\n            }\n\n            // No channel-type cases: channels (grpc, kafka, …) are configured via their rich\n            // JS object — karate.channel('kafka') / the boot.ext('kafka') object — not via global","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/KarateConfig.java#L420-L456","documentation":"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.","triggerScenarios":"A feature file or JS bootstrap containing `configure logPrettyRequest = true` or `configure logPrettyResponse = false`, typically carried over from a Karate v1 project after upgrading.","commonSituations":"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.","solutions":["Replace both keys with `configure logging = { pretty: true }` (or false) in the feature/config","Search the codebase (karate-config.js, *.feature) for logPrettyRequest/logPrettyResponse and update all occurrences","Verify pretty logging works by checking request/response output after the change","Update internal docs/templates to the v2 logging syntax"],"exampleFix":"// before\n* configure logPrettyRequest = true\n* configure logPrettyResponse = true\n// after\n* configure logging = { pretty: true }","handlingStrategy":"validation","validationCode":"grep -rnE 'configure\\s+(logPrettyRequest|logPrettyResponse)' karate-config.js features/ && echo 'deprecated configure keys found'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit karate-config.js and feature files for v1 configure keys after upgrading","Use `configure logging = { pretty: true|false }` for all pretty-log settings","Follow Karate v2 migration docs when porting configs","Treat deprecation warnings in CI logs as blocking tech debt"],"tags":["deprecation","configuration","migration","logging"],"backgroundTag":"deprecated-api-usage","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}