我看到在http://wiremock.org/running-standalone.html以独立方式运行时,有关于为wiremock启用详细日志记录的说明(请参阅--verbose)。
从java代码启动时如何启用它?
答案 0 :(得分:18)
如果您正在使用JUnit规则,则可以将通知程序设置为详细模式,如下所示:
@Rule
public WireMockRule serviceMock = new WireMockRule(new WireMockConfiguration().notifier(new Slf4jNotifier(true)));
答案 1 :(得分:5)
WireMock使用SLF4J。将类别com.github.tomakehurst.wiremock
的级别设置为TRACE
。请咨询SLF4J manual以了解如何在您的情况下完成此任务。
答案 2 :(得分:0)
将Notifier设置为ConsoleNotifier(true)。
WireMockRule wireMockRule = new WireMockRule(WireMockConfiguration.options().port(8080).httpsPort(443)
.notifier(new ConsoleNotifier(true)).extensions(new ResponseTemplateTransformer(true)));