Skip to content

Commit

Permalink
Merge pull request #224 from paulssn/Fix_Issue_223_ExceptionInExample…
Browse files Browse the repository at this point in the history
…ForWindowsService

Fixed issue 223: Example for WireMock as Windows Service throws Exception because of WireMockConsoleLogger
  • Loading branch information
StefH authored Nov 6, 2018
2 parents 9ff19b0 + 2f91f85 commit d506df9
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit d506df9

Please sign in to comment.