Add log4net logging (#89)

* logging + fixed proxy isses

* Add more logging

* comments

* 1.0.3.1
This commit is contained in:
Stef Heyenrath
2018-02-14 16:13:05 +00:00
committed by GitHub
parent 9778c5adbe
commit e21582aacf
35 changed files with 466 additions and 154 deletions

View File

@@ -1,10 +1,9 @@
using System;
using System.Linq;
using System.Linq;
using WireMock.Server;
using WireMock.Settings;
using WireMock.Validation;
using JetBrains.Annotations;
using Newtonsoft.Json;
using log4net;
namespace WireMock.Net.StandAlone
{
@@ -13,8 +12,10 @@ namespace WireMock.Net.StandAlone
/// </summary>
public static class StandAloneApp
{
private static readonly ILog Log = LogManager.GetLogger(typeof(StandAloneApp));
/// <summary>
/// Start WireMock.Net standalone based on the FluentMockServerSettings.
/// Start WireMock.Net standalone Server based on the FluentMockServerSettings.
/// </summary>
/// <param name="settings">The FluentMockServerSettings</param>
[PublicAPI]
@@ -26,7 +27,7 @@ namespace WireMock.Net.StandAlone
}
/// <summary>
/// Start WireMock.Net standalone based on the commandline arguments.
/// Start WireMock.Net standalone Server based on the commandline arguments.
/// </summary>
/// <param name="args">The commandline arguments</param>
[PublicAPI]
@@ -34,7 +35,7 @@ namespace WireMock.Net.StandAlone
{
Check.NotNull(args, nameof(args));
Console.WriteLine("WireMock.Net server arguments [{0}]", string.Join(", ", args.Select(a => $"'{a}'")));
Log.DebugFormat("WireMock.Net server arguments [{0}]", string.Join(", ", args.Select(a => $"'{a}'")));
var parser = new SimpleCommandLineParser();
parser.Parse(args);
@@ -73,11 +74,9 @@ namespace WireMock.Net.StandAlone
};
}
Console.WriteLine("WireMock.Net server settings {0}", JsonConvert.SerializeObject(settings, Formatting.Indented));
FluentMockServer server = Start(settings);
Console.WriteLine("WireMock.Net server listening at {0}", string.Join(",", server.Urls));
Log.InfoFormat("WireMock.Net server listening at {0}", string.Join(",", server.Urls));
return server;
}

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Lightweight StandAlone Http Mocking Server for .Net.</Description>
<AssemblyTitle>WireMock.Net.StandAlone</AssemblyTitle>
<Version>1.0.3</Version>
<Version>1.0.3.1</Version>
<Authors>Stef Heyenrath</Authors>
<TargetFrameworks>net452;net46;netstandard1.3;netstandard2.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -36,10 +36,7 @@
<PackageReference Include="JetBrains.Annotations" Version="10.4.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<!-- <PackageReference Include="CommandLineArgumentsParser" Version="3.0.16" /> -->
<!-- <PackageReference Include="Marsonsoft.CommandLineParser" Version="1.0.34" /> -->
<!-- <PackageReference Include="BurnSystems.CommandLine" Version="1.1.0" /> -->
<!-- <ProjectReference Include="..\..\..\CommandLineParser\src\CommandLineArgumentsParser\CommandLineArgumentsParser.csproj" /> -->
<PackageReference Include="log4net" Version="2.0.8" />
</ItemGroup>
<ItemGroup>