Hello folks - another newbie question here. I have...
# pact-jvm
f
Hello folks - another newbie question here. I have a Pact JVM consumer and I am getting 500 responses from the Mock Server. I found this documentation https://github.com/pact-foundation/pact-jvm/blob/master/consumer/junit/README.md#debugging-pact-failures but it's not clear to me 1. Where to set the log level? I tried something like the following without luck
Copy code
./gradlew contractTest --debug
2. Is there a log file as opposed to StdOut? Thanks in advance
m
Most Java projects use SLF4j or logback or whatever right, so there should be an XML file or something where you can specify which packages can log at a given level
<http://au.com|au.com>.dius.pact.consumer.UnfilteredMockProvider
is the package you want to set to
DEBUG
.
I think if you’re using the spring packages, it should show up in the stdout of the HTML file it spits out
u
Huh! UnfilteredMockProvider is the old Scala implementation, which was replaced years ago. Setting the package
<http://au.com|au.com>.dius.pact.consumer
as DEBUG will work
thankyou 1
f
Thanks everyone - in the end I found I had to 1. Add the following logback dependencies
Copy code
contractImplementation('ch.qos.logback:logback-classic')
    contractImplementation('ch.qos.logback:logback-core')
2. Add a `logback-test.xml`file to lhe classpath to log to std out 3. And add the following to my contract test task in the gradle file
Copy code
testLogging.showStandardStreams = true
🙌 1