mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 13:00:33 +01:00
How to log un/matched requests and responses? #734
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Swimburger on GitHub (Dec 18, 2025).
Originally assigned to: @StefH on GitHub.
This library is super useful, but it's been hard to debug because requests and responses are not being logged.
Ideally, we'd like to not log by default, but log when debugging is enabled somehow. This is our current setup:
BaseMockServerTest.cs:
GetAndReturnListOfObjectsTest.cs:
We use version 1.7.4 but 1.19.0 also doens't log. We do see the server configation logged:
Is there a way to turn on logging for requests/responses? Thank you in advance!
@StefH commented on GitHub (Dec 20, 2025):
@Swimburger
It could be that logging in a unit test does not work correct.
In that case you can create your own implementation like this:
--> Not that I'll create a new nuget for this class which can be used.
@StefH commented on GitHub (Dec 20, 2025):
https://github.com/wiremock/WireMock.Net/pull/1400