diff --git a/.gitignore b/.gitignore index fd5204b..10016f0 100644 --- a/.gitignore +++ b/.gitignore @@ -181,3 +181,4 @@ UpgradeLog*.htm # Microsoft Fakes FakesAssemblies/ +/.vs diff --git a/Sample/Serilog.Sinks.Log4Net.Sample/Serilog.Sinks.Log4Net.Sample.csproj b/Sample/Serilog.Sinks.Log4Net.Sample/Serilog.Sinks.Log4Net.Sample.csproj index 2de93bd..1887f7b 100644 --- a/Sample/Serilog.Sinks.Log4Net.Sample/Serilog.Sinks.Log4Net.Sample.csproj +++ b/Sample/Serilog.Sinks.Log4Net.Sample/Serilog.Sinks.Log4Net.Sample.csproj @@ -33,21 +33,20 @@ 4 - - ..\..\packages\log4net.2.0.5\lib\net45-full\log4net.dll - True + + ..\..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - ..\..\packages\Serilog.2.2.1\lib\net45\Serilog.dll - True + ..\..\packages\Serilog.2.9.0\lib\net45\Serilog.dll - ..\..\packages\Serilog.Enrichers.Thread.2.0.0\lib\net45\Serilog.Enrichers.Thread.dll - True + ..\..\packages\Serilog.Enrichers.Thread.3.1.0\lib\net45\Serilog.Enrichers.Thread.dll - - ..\..\packages\Serilog.Sinks.ColoredConsole.2.0.0\lib\net45\Serilog.Sinks.ColoredConsole.dll - True + + ..\..\packages\Serilog.Sinks.ColoredConsole.3.0.1\lib\net45\Serilog.Sinks.ColoredConsole.dll + + + ..\..\packages\Serilog.Sinks.Console.3.0.1\lib\net45\Serilog.Sinks.Console.dll @@ -67,7 +66,7 @@ - {83ea2b05-ff47-40c8-92c3-1f58aeec7ce0} + {6f098c9c-3134-4cd5-8caf-bbc79d4bfc81} Serilog.Sinks.Log4Net diff --git a/Sample/Serilog.Sinks.Log4Net.Sample/packages.config b/Sample/Serilog.Sinks.Log4Net.Sample/packages.config index 04b58ed..fe70db2 100644 --- a/Sample/Serilog.Sinks.Log4Net.Sample/packages.config +++ b/Sample/Serilog.Sinks.Log4Net.Sample/packages.config @@ -1,7 +1,8 @@  - - - - + + + + + \ No newline at end of file diff --git a/serilog-sinks-log4net.sln b/serilog-sinks-log4net.sln index 00991c5..6bb7228 100644 --- a/serilog-sinks-log4net.sln +++ b/serilog-sinks-log4net.sln @@ -1,28 +1,28 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29609.76 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net", "src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj", "{83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{FC737230-09E6-42BD-894C-613842FA30B2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net.Sample", "Sample\Serilog.Sinks.Log4Net.Sample\Serilog.Sinks.Log4Net.Sample.csproj", "{7FF6875B-62E3-433A-803A-AB9F9F09834B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Sinks.Log4Net", "src\Serilog.Sinks.Log4Net\Serilog.Sinks.Log4Net.csproj", "{6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0}.Release|Any CPU.Build.0 = Release|Any CPU {7FF6875B-62E3-433A-803A-AB9F9F09834B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7FF6875B-62E3-433A-803A-AB9F9F09834B}.Debug|Any CPU.Build.0 = Debug|Any CPU {7FF6875B-62E3-433A-803A-AB9F9F09834B}.Release|Any CPU.ActiveCfg = Release|Any CPU {7FF6875B-62E3-433A-803A-AB9F9F09834B}.Release|Any CPU.Build.0 = Release|Any CPU + {6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F098C9C-3134-4CD5-8CAF-BBC79D4BFC81}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -30,4 +30,7 @@ Global GlobalSection(NestedProjects) = preSolution {7FF6875B-62E3-433A-803A-AB9F9F09834B} = {FC737230-09E6-42BD-894C-613842FA30B2} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2923C285-4274-47CC-8270-7E96D4B06AB5} + EndGlobalSection EndGlobal diff --git a/src/Serilog.Sinks.Log4Net/Properties/AssemblyInfo.cs b/src/Serilog.Sinks.Log4Net/Properties/AssemblyInfo.cs deleted file mode 100644 index c289209..0000000 --- a/src/Serilog.Sinks.Log4Net/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System.Reflection; - -[assembly: AssemblyTitle("Serilog.Sinks.Log4Net")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2014")] \ No newline at end of file diff --git a/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.csproj b/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.csproj index 71886ac..f7654fc 100644 --- a/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.csproj +++ b/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.csproj @@ -1,78 +1,23 @@ - - - - - Debug - AnyCPU - {83EA2B05-FF47-40C8-92C3-1F58AEEC7CE0} - Library - Properties - Serilog - Serilog.Sinks.Log4Net - v4.5 - 512 - ..\..\ - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Serilog.Sinks.Log4Net.XML - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Serilog.Sinks.Log4Net.XML - true - + + + netstandard2.0;net45 true + C:\Users\Mathias\Source\Repos\mparge\serilog-sinks-log4net\assets\Serilog.snk + Copyright © Serilog Contributors 2014 + + + 1.1.1.1 - - ..\..\assets\Serilog.snk - - - - ..\..\packages\log4net.2.0.5\lib\net45-full\log4net.dll - True - - - ..\..\packages\Serilog.2.2.1\lib\net45\Serilog.dll - True - - - - - - - - - + - - - - Properties\CommonAssemblyInfo.cs - - + + - - Serilog.snk - - - - Designer - + + + - - \ No newline at end of file + + diff --git a/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.nuspec b/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.nuspec index 1e2ef59..d769839 100644 --- a/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.nuspec +++ b/src/Serilog.Sinks.Log4Net/Serilog.Sinks.Log4Net.nuspec @@ -11,8 +11,8 @@ Serilog event sink that writes to Log4Net. Merge your new Serilog event stream into your existing log4net infrastructure. serilog logging log4net - - + + diff --git a/src/Serilog.Sinks.Log4Net/Sinks/Log4Net/Log4NetSink.cs b/src/Serilog.Sinks.Log4Net/Sinks/Log4Net/Log4NetSink.cs index dcfa671..ce3240e 100644 --- a/src/Serilog.Sinks.Log4Net/Sinks/Log4Net/Log4NetSink.cs +++ b/src/Serilog.Sinks.Log4Net/Sinks/Log4Net/Log4NetSink.cs @@ -13,11 +13,11 @@ // limitations under the License. using System; -using System.Security.AccessControl; using Serilog.Core; using Serilog.Debugging; using Serilog.Events; using log4net; +using System.Reflection; namespace Serilog.Sinks.Log4Net { @@ -55,8 +55,8 @@ public void Emit(LogEvent logEvent) var message = logEvent.RenderMessage(_formatProvider); var exception = logEvent.Exception; - - var logger = LogManager.GetLogger(loggerName); + + var logger = LogManager.GetLogger(Assembly.GetCallingAssembly(), loggerName); using (_supplyContextMessage ? ThreadContext.Stacks["NDC"].Push(ContextMessage) : new NullDisposable()) {