How to enable verbose logging in non standalone wiremock

Superaghu picture Superaghu · Dec 23, 2015 · Viewed 15k times · Source

I see that there are instructions on enabling verbose logging for wiremock when running it in standalone fashion at http://wiremock.org/running-standalone.html (see --verbose).

How do I enable the same when starting it from a java code?

Answer

Jason picture Jason · Oct 27, 2016

If you're using a JUnit Rule, you can set the notifier to verbose mode like this:

@Rule
public WireMockRule serviceMock = new WireMockRule(new WireMockConfiguration().notifier(new Slf4jNotifier(true)));