mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-29 13:52:08 +02:00
Fixed issue 223: Example for WireMock as Windows Service throws Exception because of WireMockConsoleLogger
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Wiremock.Net.Service
|
|||||||
|
|
||||||
protected override void OnStart(string[] args)
|
protected override void OnStart(string[] args)
|
||||||
{
|
{
|
||||||
Start();
|
Start(new WireMockNullLogger());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnStop()
|
protected override void OnStop()
|
||||||
@@ -46,7 +46,7 @@ namespace Wiremock.Net.Service
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// running as console app
|
// running as console app
|
||||||
Start();
|
Start(new WireMockConsoleLogger());
|
||||||
|
|
||||||
Console.WriteLine("Press any key to stop...");
|
Console.WriteLine("Press any key to stop...");
|
||||||
Console.ReadKey(true);
|
Console.ReadKey(true);
|
||||||
@@ -55,14 +55,14 @@ namespace Wiremock.Net.Service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Start()
|
private static void Start(IWireMockLogger logger)
|
||||||
{
|
{
|
||||||
_server = StandAloneApp.Start(new FluentMockServerSettings
|
_server = StandAloneApp.Start(new FluentMockServerSettings
|
||||||
{
|
{
|
||||||
Urls = new[] { "http://*:9091/" },
|
Urls = new[] { "http://*:9091/" },
|
||||||
StartAdminInterface = true,
|
StartAdminInterface = true,
|
||||||
ReadStaticMappings = true,
|
ReadStaticMappings = true,
|
||||||
Logger = new WireMockConsoleLogger()
|
Logger = logger
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user