3

Is there any way to enable and disable the thymeleaf report from the logs? I couldn't find any config flag to do, so is there any other way to switch it on/off?

1 Answers1

4

This can happen when your project has a bunch of dependencies and something in your "test-classpath" has configured the logger before Karate, or the logback-test.xml was not found on the classpath.

So start here first: https://github.com/karatelabs/karate#logging

When you mix Karate with Spring, Quarkus or Micronaut, Graal or logging dependencies can cause conflicts. Refer to the integration examples for samples and solutions. Using the karate "fat jar" can avoid dependency conflicts in some cases.

Or if you are using some combination of dependencies or building a JAR on your own (which we don't support, you have to figure this out on your own).

In that case, this thread may give you some ideas: https://github.com/intuit/karate/issues/1694

Finally, if you insist that this is some issue with Karate - please follow this process so that we can fix it: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • I put the debugger on INFO and that thymeleaf stuff is still being show. I don't think that is showing something relevant to tests and common users. – italktothewind Feb 06 '22 at 10:33
  • @italktothewind I have nothing to add to my answer – Peter Thomas Feb 06 '22 at 11:24
  • I'm using logback-test.xml (a different file from the logback.xml of the app) and there is no way to turn off the thymeleaf stuff. It is a bit annoying that almost all the log is related to a template framework that all the Karate users except from you don't care about, instead of just displaying the tests info. So probably there are things to add to your answer :) – italktothewind Feb 06 '22 at 11:57
  • @italktothewind no there aren't – Peter Thomas Feb 06 '22 at 12:01
  • 2
    did the trick. I was using org.thymeleaf. Hope this can help other users. – italktothewind Feb 08 '22 at 17:54
  • 1
    In my case, the logback file was named `logback-spring.xml`, so the logger in there was ignored in favor of some karate-internal logback file (`logback-fatjar.xml`, perhaps?) per the issue linked in the answer, and so the `karate.org.thymeleaf` logger was always at DEBUG level regardless of what I set it to in my `logback-spring.xml`. I had to rename the file to `logback.xml` for my logger configuration to be picked up, which was easy enough since it didn't have any spring profile stuff. – mystarrocks Apr 20 '22 at 19:11
  • 1
    @italktothewind maybe put your comment as an answer, as it did help me to fix the same issue. – Robert van der Spek Jun 13 '22 at 13:55
  • 1
    @RobertvanderSpek thanks I edited my answer to include this info – Peter Thomas Jun 13 '22 at 16:07