mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
WireMock Standalone - null reference exception since settings.Logger #244
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 @larsbrekken on GitHub (Feb 1, 2020).
Two observations about the documentation at
https://github.com/WireMock-Net/WireMock.Net/wiki/WireMock-as-a-standalone-process
The page lists the argument
--WireMockConsoleLogger, however the correct name isWireMockLogger. See https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net/Settings/WireMockServerSettingsParser.cs#L46-L49The page also says that the default logger is
WireMockNullLogger, however if you try not to supply a logger you get a null reference exception sincesettings.Loggerremains null and a line in StandAloneApp tries to use it:https://github.com/WireMock-Net/WireMock.Net/blob/master/src/WireMock.Net.StandAlone/StandAloneApp.cs#L43
@StefH commented on GitHub (Feb 2, 2020):
OK: updated
This is indeed a bug. If there is no logger, you cannot log.
What would be solution?
@larsbrekken commented on GitHub (Feb 2, 2020):
Thanks Stef.
For 2, if the default is
WireMockNullLoggerit seems ok not to log at all if the consumer has not specified a logger, at least that would be my expectation. So my vote would be to only log that statement when a logger is present.@StefH commented on GitHub (Feb 5, 2020):
https://github.com/WireMock-Net/WireMock.Net/pull/414