Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue 223: Example for WireMock as Windows Service throws Exception because of WireMockConsoleLogger #224

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/WireMock.Net.Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Service()

protected override void OnStart(string[] args)
{
Start();
Start(new WireMockNullLogger());
}

protected override void OnStop()
Expand All @@ -46,7 +46,7 @@ static void Main(string[] args)
else
{
// running as console app
Start();
Start(new WireMockConsoleLogger());

Console.WriteLine("Press any key to stop...");
Console.ReadKey(true);
Expand All @@ -55,14 +55,14 @@ static void Main(string[] args)
}
}

private static void Start()
private static void Start(IWireMockLogger logger)
{
_server = StandAloneApp.Start(new FluentMockServerSettings
{
Urls = new[] { "http://*:9091/" },
StartAdminInterface = true,
ReadStaticMappings = true,
Logger = new WireMockConsoleLogger()
Logger = logger
});
}

Expand Down