问题
I'm using Karate for validation tests.
I setup a retry on one of my request but sometimes there is more than 100 retry, this create to big useless logs with the same big payload on each request... And this bloat my CI.
I want to reduce this logs quantity, maybe by disable log for just this request ?
I've tried * configure report = false
but this disable only on Cucumber html report.
I want to disable also in STDOUT console.
So maybe with some form of log level manipulation setted in the logback-test.xml
?
Thanks.
回答1:
No you con't disable logs per request, you can switch off everything by setting the log level to INFO
- but I guess you don't want that. 100 retries sounds very unusual to me. You can try your luck with a feature request - but I can tell you that this would be low priority unless someone contributes code.
If this really bothers you, write some custom Java code to do this polling + HTTP request and call it from Karate.
EDIT: I think I have a solution that will work for you. You can completely disable the Karate logs appearing on the console - while still having the HTML report with this change to the logback-test.xml
:
<root level="warn">
<!-- <appender-ref ref="STDOUT" /> -->
<appender-ref ref="FILE" />
</root>
So just commenting out the console log appender will do the trick !
来源:https://stackoverflow.com/questions/56937370/karate-is-there-a-way-to-disable-log-when-using-retry