How to Disable Thymeleaf Debug Logs in Karate DSL
- 01 Jun, 2026
When running tests with Karate DSL, you may suddenly see your console flooded with logs like this:
15:59:11.382 [pool-2-thread-1] DEBUG org.thymeleaf.TemplateEngine - [THYMELEAF] INITIALIZING TEMPLATE ENGINE
15:59:11.476 [pool-2-thread-1] DEBUG org.thymeleaf.TemplateEngine.CONFIG - Initializing Thymeleaf Template engine configuration...
[THYMELEAF] TEMPLATE ENGINE CONFIGURATION:
[THYMELEAF] * Thymeleaf version: 3.1.2.RELEASE
[THYMELEAF] * Cache Manager implementation: org.thymeleaf.cache.StandardCacheManager
[THYMELEAF] * Template resolvers: ...
[THYMELEAF] * Dialect [1 of 2]: Standard (com.intuit.karate.template.KarateStandardDialect)
[THYMELEAF] * Prefix: "th"
[THYMELEAF] * Processors for Template Mode: HTML ...
Instead of clean API test output, your execution gets filled with Thymeleaf configuration details, HTML processors, and internal engine setup logs.
Main Fix
The fastest and cleanest way to keep your console readable is to explicitly set the log level for Thymeleaf to INFO or WARN in your logging configuration file.
Locate your log configuration file—typically named logback-test.xml or logback.xml and usually found in src/test/java/ or src/test/resources/:
<logger name="org.thymeleaf" level="INFO"/>
This keeps your Karate execution logs much cleaner while still preserving useful information.
You can also reduce noisy Apache HTTP debug logs with:
<logger name="org.apache.http" level="INFO"/>
Why This Happens
Karate uses Thymeleaf internally to generate its HTML execution reports.
If your project logging level is set to DEBUG, Thymeleaf prints its full initialization process during test startup, which creates the huge log dump.
Alternative Fix: Check Dependency Versions
If the logs still look excessive, check your pom.xml for old Karate dependencies mixed with newer versions.
For example, this combination can cause logging conflicts:
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit5</artifactId>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>0.9.6</version>
<scope>test</scope>
</dependency>
In modern Karate versions, karate-apache is no longer needed.
Safely delete the karate-apache dependency block entirely, this usually fixes duplicated initialization and unnecessary logging. Your modern karate-junit5 or karate-core artifact is all you need to execute smoothly.