From 3b9d8f4c164c42034667117b8a00b8070e790ac7 Mon Sep 17 00:00:00 2001 From: Matthias Heil Date: Sat, 4 Apr 2026 13:49:12 +0200 Subject: [PATCH] Deleted unnecessary files Not compiling --- .../AvaloniaLoggingDI.csproj | 7 +- .../AvaloniaLoggingNoDI.csproj | 7 +- .../AvaloniaSerilogDI.csproj | 29 +- .../AvaloniaSerilogNoDI.csproj | 27 +- .../RandomLogging.Service.csproj | 3 +- .../LogViewer.Avalonia.csproj | 15 +- CSharp/Core/Common.Core/Common.Core.csproj | 12 +- .../Core/LogViewer.Core/LogViewer.Core.csproj | 8 +- .../Core/MsLogger.Core/MsLogger.Core.csproj | 6 +- CSharp/Core/Mvvm.Core/Mvvm.Core.csproj | 4 +- .../Serilog.Sinks.LogView.Core.csproj | 6 +- Logging - CS.sln | 87 +--- .../Appenders/IAppenderServiceProvider.cs | 8 - .../Appenders/ServiceAppenderSkeleton.cs | 20 - .../Entities/EventIDLogImpl.cs | 22 - .../Entities/IEventIDLog .cs | 9 - .../Entities/MessageCandidate.cs | 54 -- .../Entities/NodeInfo.cs | 34 -- .../Extensions/DocumentExtensions.cs | 44 -- .../Extensions/Log4NetProviderExtensions.cs | 33 -- .../Extensions/LogExtensions.cs | 29 -- .../ILog4NetLogLevelTranslator.cs | 16 - .../ILog4NetLoggingEventFactory.cs | 25 - .../LICENSE | 201 -------- .../Log4NetExtensions.cs | 100 ---- .../Log4NetLogLevelTranslator.cs | 42 -- .../Log4NetLogger.cs | 124 ----- .../Log4NetLoggingEventFactory.cs | 140 ------ .../Log4NetProvider.cs | 469 ------------------ .../Log4NetProviderOptions.cs | 99 ---- ...tensions.Logging.Log4Net.AspNetCore.csproj | 59 --- .../Scope/NullScope.cs | 28 -- .../Scope/NullScopeProvider.cs | 34 -- 33 files changed, 51 insertions(+), 1750 deletions(-) delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/IAppenderServiceProvider.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/ServiceAppenderSkeleton.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/EventIDLogImpl.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/IEventIDLog .cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/MessageCandidate.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/NodeInfo.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/DocumentExtensions.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/Log4NetProviderExtensions.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/LogExtensions.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLogLevelTranslator.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLoggingEventFactory.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/LICENSE delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetExtensions.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogLevelTranslator.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogger.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLoggingEventFactory.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProvider.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProviderOptions.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Microsoft.Extensions.Logging.Log4Net.AspNetCore.csproj delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScope.cs delete mode 100644 Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScopeProvider.cs diff --git a/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj b/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj index 4295e30..a7349ff 100644 --- a/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj +++ b/CSharp/Applications/AvaloniaLoggingDI/AvaloniaLoggingDI.csproj @@ -1,9 +1,7 @@  WinExe - net7.0 - enable - true + true app.manifest @@ -24,11 +22,10 @@ - + - diff --git a/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj b/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj index 5c582c8..38c4b0f 100644 --- a/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj +++ b/CSharp/Applications/AvaloniaLoggingNoDI/AvaloniaLoggingNoDI.csproj @@ -2,9 +2,7 @@ WinExe - net7.0 - enable - true + true app.manifest @@ -25,11 +23,10 @@ - + - diff --git a/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj b/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj index 0acebe5..10c6bde 100644 --- a/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj +++ b/CSharp/Applications/AvaloniaSerilogDI/AvaloniaSerilogDI.csproj @@ -1,8 +1,6 @@  WinExe - net7.0 - enable true app.manifest @@ -24,23 +22,22 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - diff --git a/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj b/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj index 52bdddd..f9ba074 100644 --- a/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj +++ b/CSharp/Applications/AvaloniaSerilogNoDI/AvaloniaSerilogNoDI.csproj @@ -1,8 +1,6 @@  WinExe - net7.0 - enable true app.manifest @@ -24,22 +22,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + - diff --git a/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj b/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj index 9d0cb97..620aef0 100644 --- a/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj +++ b/CSharp/Background Services/RandomLogging.Service/RandomLogging.Service.csproj @@ -1,13 +1,12 @@ - net7.0 enable enable - + diff --git a/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj b/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj index 6dc5021..2d4e0f5 100644 --- a/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj +++ b/CSharp/Controls/LogViewer.Avalonia/LogViewer.Avalonia.csproj @@ -1,20 +1,19 @@ - net7.0 - enable + enable enable - - - + + + - - + + - + diff --git a/CSharp/Core/Common.Core/Common.Core.csproj b/CSharp/Core/Common.Core/Common.Core.csproj index 6bcf4d4..5b90f3a 100644 --- a/CSharp/Core/Common.Core/Common.Core.csproj +++ b/CSharp/Core/Common.Core/Common.Core.csproj @@ -1,17 +1,15 @@ - net7.0 enable - enable - - - - - + + + + + diff --git a/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj b/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj index e3c1dd5..1f935d9 100644 --- a/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj +++ b/CSharp/Core/LogViewer.Core/LogViewer.Core.csproj @@ -1,13 +1,11 @@ - net7.0 - enable - enable - + enable + - + diff --git a/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj b/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj index 79f2d71..6835542 100644 --- a/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj +++ b/CSharp/Core/MsLogger.Core/MsLogger.Core.csproj @@ -1,14 +1,12 @@ - net7.0 enable - enable - - + + diff --git a/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj b/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj index cfadb03..7326a62 100644 --- a/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj +++ b/CSharp/Core/Mvvm.Core/Mvvm.Core.csproj @@ -1,9 +1,7 @@ - net7.0 - enable - enable + enable diff --git a/CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj b/CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj index e530631..bf3a7a1 100644 --- a/CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj +++ b/CSharp/Core/Serilog.Sinks.LogView.Core/Serilog.Sinks.LogView.Core.csproj @@ -1,13 +1,11 @@ - net7.0 - enable - enable + enable - + diff --git a/Logging - CS.sln b/Logging - CS.sln index b71efe5..9953115 100644 --- a/Logging - CS.sln +++ b/Logging - CS.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 18 -VisualStudioVersion = 18.4.11626.88 stable +VisualStudioVersion = 18.4.11626.88 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9}" EndProject @@ -13,18 +13,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Apps", "Apps", "{42E99803-0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Controls", "Controls", "{E589E611-C328-4D4F-817D-A91D5A1019FB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfLoggingDI", "CSharp\Applications\WpfLoggingDI\WpfLoggingDI.csproj", "{9FF3C1CB-C95B-4660-8DD7-9B367824B67C}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Background Services", "Background Services", "{0CDEA51D-46FE-4767-BA2E-8F14582A926D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsLoggingDI", "CSharp\Applications\WinFormsLoggingDI\WinFormsLoggingDI.csproj", "{82EA3F1F-8267-4920-AD4B-BA7087BBD5DA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsLoggingNoDI", "CSharp\Applications\WinFormsLoggingNoDI\WinFormsLoggingNoDI.csproj", "{E17466C3-8CC2-43EA-81C7-85F7EB1A7BAB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Core", "CSharp\Core\Common.Core\Common.Core.csproj", "{1688A0C1-1AE6-49F6-972E-C419E2A3B58F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfLoggingNoDI", "CSharp\Applications\WpfLoggingNoDI\WpfLoggingNoDI.csproj", "{622A3C25-28FD-484A-9CA5-E468CE926673}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{006FDAED-6319-4976-B8BA-8D94E4574139}" ProjectSection(SolutionItems) = preProject LICENSE = LICENSE @@ -41,12 +33,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MsLogger", "MsLogger", "{86 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Serilog", "Serilog", "{578FF757-F837-4C23-B2CA-3CF8B016F6A9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfSerilogDI", "CSharp\Applications\WpfSerilogDI\WpfSerilogDI.csproj", "{59A05E46-AB33-4F81-BDF6-3E8C3A1F5D5C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.LogView.Core", "CSharp\Core\Serilog.Sinks.LogView.Core\Serilog.Sinks.LogView.Core.csproj", "{69763AFC-6182-402D-9418-6A48404C89A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfSerilogNoDI", "CSharp\Applications\WpfSerilogNoDI\WpfSerilogNoDI.csproj", "{E666F716-F9BD-4630-8610-D41E965B28BA}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaLoggingDI", "CSharp\Applications\AvaloniaLoggingDI\AvaloniaLoggingDI.csproj", "{EA97953E-1223-40D5-A568-8932FDC3105E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LogViewer.Avalonia", "CSharp\Controls\LogViewer.Avalonia\LogViewer.Avalonia.csproj", "{C34C889C-4EB3-45F6-83DE-70252D1D67D5}" @@ -55,24 +43,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSerilogDI", "CSharp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSerilogNoDI", "CSharp\Applications\AvaloniaSerilogNoDI\AvaloniaSerilogNoDI.csproj", "{4E892500-CF59-43A9-9A27-80D8EE028821}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsSerilogDI", "CSharp\Applications\WinFormsSerilogDI\WinFormsSerilogDI.csproj", "{44282198-F1B3-4C63-A52E-D2E6651D298C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsSerilogNoDI", "CSharp\Applications\WinFormsSerilogNoDI\WinFormsSerilogNoDI.csproj", "{4F3E2263-7FDD-4EBF-929D-1013473720BE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaLoggingNoDI", "CSharp\Applications\AvaloniaLoggingNoDI\AvaloniaLoggingNoDI.csproj", "{85C96F55-572A-4FDF-A028-12D27A48FB4D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rd Party", "3rd Party", "{A0B29205-19C3-4FF8-B3A0-28E9E9182E86}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resources", "Resources", "{7CD1D21E-CCCF-4458-B5E5-63ED2081E439}" -EndProject -Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Avalonia.Resources", "Resources\Avalonia.Resources\Avalonia.Resources.vbproj", "{30AB364F-51E4-4255-865D-1D163B5F82BC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Logging.Log4Net.AspNetCore", "Resources\3rd Party\Microsoft.Extensions.Logging.Log4Net.AspNetCore\Microsoft.Extensions.Logging.Log4Net.AspNetCore.csproj", "{170F33B5-C7C4-4D97-8DB9-DE508E2DFCD0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Attribute", "Attribute", "{78E23FC2-A337-4FC2-AEBF-CDC517AEA30C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfLoggingAttrDI", "CSharp\Applications\WpfLoggingAttrDI\WpfLoggingAttrDI.csproj", "{06700271-27A1-4236-9AB3-B45CE431FE0C}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -87,26 +59,10 @@ Global {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Debug|Any CPU.Build.0 = Debug|Any CPU {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Release|Any CPU.ActiveCfg = Release|Any CPU {34F75D8B-6F15-4DE4-8335-FED83557EB8E}.Release|Any CPU.Build.0 = Release|Any CPU - {9FF3C1CB-C95B-4660-8DD7-9B367824B67C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9FF3C1CB-C95B-4660-8DD7-9B367824B67C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9FF3C1CB-C95B-4660-8DD7-9B367824B67C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9FF3C1CB-C95B-4660-8DD7-9B367824B67C}.Release|Any CPU.Build.0 = Release|Any CPU - {82EA3F1F-8267-4920-AD4B-BA7087BBD5DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82EA3F1F-8267-4920-AD4B-BA7087BBD5DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82EA3F1F-8267-4920-AD4B-BA7087BBD5DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82EA3F1F-8267-4920-AD4B-BA7087BBD5DA}.Release|Any CPU.Build.0 = Release|Any CPU - {E17466C3-8CC2-43EA-81C7-85F7EB1A7BAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E17466C3-8CC2-43EA-81C7-85F7EB1A7BAB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E17466C3-8CC2-43EA-81C7-85F7EB1A7BAB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E17466C3-8CC2-43EA-81C7-85F7EB1A7BAB}.Release|Any CPU.Build.0 = Release|Any CPU {1688A0C1-1AE6-49F6-972E-C419E2A3B58F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1688A0C1-1AE6-49F6-972E-C419E2A3B58F}.Debug|Any CPU.Build.0 = Debug|Any CPU {1688A0C1-1AE6-49F6-972E-C419E2A3B58F}.Release|Any CPU.ActiveCfg = Release|Any CPU {1688A0C1-1AE6-49F6-972E-C419E2A3B58F}.Release|Any CPU.Build.0 = Release|Any CPU - {622A3C25-28FD-484A-9CA5-E468CE926673}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {622A3C25-28FD-484A-9CA5-E468CE926673}.Debug|Any CPU.Build.0 = Debug|Any CPU - {622A3C25-28FD-484A-9CA5-E468CE926673}.Release|Any CPU.ActiveCfg = Release|Any CPU - {622A3C25-28FD-484A-9CA5-E468CE926673}.Release|Any CPU.Build.0 = Release|Any CPU {18BA2294-FE64-481F-A86F-F5FD84438B66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {18BA2294-FE64-481F-A86F-F5FD84438B66}.Debug|Any CPU.Build.0 = Debug|Any CPU {18BA2294-FE64-481F-A86F-F5FD84438B66}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -115,18 +71,10 @@ Global {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Debug|Any CPU.Build.0 = Debug|Any CPU {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Release|Any CPU.ActiveCfg = Release|Any CPU {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E}.Release|Any CPU.Build.0 = Release|Any CPU - {59A05E46-AB33-4F81-BDF6-3E8C3A1F5D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59A05E46-AB33-4F81-BDF6-3E8C3A1F5D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59A05E46-AB33-4F81-BDF6-3E8C3A1F5D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59A05E46-AB33-4F81-BDF6-3E8C3A1F5D5C}.Release|Any CPU.Build.0 = Release|Any CPU {69763AFC-6182-402D-9418-6A48404C89A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {69763AFC-6182-402D-9418-6A48404C89A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {69763AFC-6182-402D-9418-6A48404C89A0}.Release|Any CPU.ActiveCfg = Release|Any CPU {69763AFC-6182-402D-9418-6A48404C89A0}.Release|Any CPU.Build.0 = Release|Any CPU - {E666F716-F9BD-4630-8610-D41E965B28BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E666F716-F9BD-4630-8610-D41E965B28BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E666F716-F9BD-4630-8610-D41E965B28BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E666F716-F9BD-4630-8610-D41E965B28BA}.Release|Any CPU.Build.0 = Release|Any CPU {EA97953E-1223-40D5-A568-8932FDC3105E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EA97953E-1223-40D5-A568-8932FDC3105E}.Debug|Any CPU.Build.0 = Debug|Any CPU {EA97953E-1223-40D5-A568-8932FDC3105E}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -143,30 +91,10 @@ Global {4E892500-CF59-43A9-9A27-80D8EE028821}.Debug|Any CPU.Build.0 = Debug|Any CPU {4E892500-CF59-43A9-9A27-80D8EE028821}.Release|Any CPU.ActiveCfg = Release|Any CPU {4E892500-CF59-43A9-9A27-80D8EE028821}.Release|Any CPU.Build.0 = Release|Any CPU - {44282198-F1B3-4C63-A52E-D2E6651D298C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44282198-F1B3-4C63-A52E-D2E6651D298C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44282198-F1B3-4C63-A52E-D2E6651D298C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44282198-F1B3-4C63-A52E-D2E6651D298C}.Release|Any CPU.Build.0 = Release|Any CPU - {4F3E2263-7FDD-4EBF-929D-1013473720BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F3E2263-7FDD-4EBF-929D-1013473720BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F3E2263-7FDD-4EBF-929D-1013473720BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4F3E2263-7FDD-4EBF-929D-1013473720BE}.Release|Any CPU.Build.0 = Release|Any CPU {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Debug|Any CPU.Build.0 = Debug|Any CPU {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {85C96F55-572A-4FDF-A028-12D27A48FB4D}.Release|Any CPU.Build.0 = Release|Any CPU - {30AB364F-51E4-4255-865D-1D163B5F82BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {30AB364F-51E4-4255-865D-1D163B5F82BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {30AB364F-51E4-4255-865D-1D163B5F82BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {30AB364F-51E4-4255-865D-1D163B5F82BC}.Release|Any CPU.Build.0 = Release|Any CPU - {170F33B5-C7C4-4D97-8DB9-DE508E2DFCD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {170F33B5-C7C4-4D97-8DB9-DE508E2DFCD0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {170F33B5-C7C4-4D97-8DB9-DE508E2DFCD0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {170F33B5-C7C4-4D97-8DB9-DE508E2DFCD0}.Release|Any CPU.Build.0 = Release|Any CPU - {06700271-27A1-4236-9AB3-B45CE431FE0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06700271-27A1-4236-9AB3-B45CE431FE0C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06700271-27A1-4236-9AB3-B45CE431FE0C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06700271-27A1-4236-9AB3-B45CE431FE0C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -174,31 +102,18 @@ Global GlobalSection(NestedProjects) = preSolution {BB614345-449F-46AD-BE8C-5E2B7616EDE2} = {A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9} {34F75D8B-6F15-4DE4-8335-FED83557EB8E} = {A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9} - {9FF3C1CB-C95B-4660-8DD7-9B367824B67C} = {8635B709-1D5A-4445-AC45-F99EE264634F} - {82EA3F1F-8267-4920-AD4B-BA7087BBD5DA} = {8635B709-1D5A-4445-AC45-F99EE264634F} - {E17466C3-8CC2-43EA-81C7-85F7EB1A7BAB} = {8635B709-1D5A-4445-AC45-F99EE264634F} {1688A0C1-1AE6-49F6-972E-C419E2A3B58F} = {A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9} - {622A3C25-28FD-484A-9CA5-E468CE926673} = {8635B709-1D5A-4445-AC45-F99EE264634F} {18BA2294-FE64-481F-A86F-F5FD84438B66} = {0CDEA51D-46FE-4767-BA2E-8F14582A926D} {0EDAAABD-495D-43A4-BDFB-A0506CAAC07E} = {23CB559B-2361-4ED6-8A26-D1B1C2005D65} {23CB559B-2361-4ED6-8A26-D1B1C2005D65} = {A3BEB004-4DF7-4281-9A08-8A7BCD4E3CC9} {8635B709-1D5A-4445-AC45-F99EE264634F} = {42E99803-0A95-4172-9079-3B8BF8CBDE9F} {578FF757-F837-4C23-B2CA-3CF8B016F6A9} = {42E99803-0A95-4172-9079-3B8BF8CBDE9F} - {59A05E46-AB33-4F81-BDF6-3E8C3A1F5D5C} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9} {69763AFC-6182-402D-9418-6A48404C89A0} = {23CB559B-2361-4ED6-8A26-D1B1C2005D65} - {E666F716-F9BD-4630-8610-D41E965B28BA} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9} {EA97953E-1223-40D5-A568-8932FDC3105E} = {8635B709-1D5A-4445-AC45-F99EE264634F} {C34C889C-4EB3-45F6-83DE-70252D1D67D5} = {E589E611-C328-4D4F-817D-A91D5A1019FB} {BCB0601D-E042-4949-8172-7A35A619519C} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9} {4E892500-CF59-43A9-9A27-80D8EE028821} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9} - {44282198-F1B3-4C63-A52E-D2E6651D298C} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9} - {4F3E2263-7FDD-4EBF-929D-1013473720BE} = {578FF757-F837-4C23-B2CA-3CF8B016F6A9} {85C96F55-572A-4FDF-A028-12D27A48FB4D} = {8635B709-1D5A-4445-AC45-F99EE264634F} - {A0B29205-19C3-4FF8-B3A0-28E9E9182E86} = {7CD1D21E-CCCF-4458-B5E5-63ED2081E439} - {30AB364F-51E4-4255-865D-1D163B5F82BC} = {7CD1D21E-CCCF-4458-B5E5-63ED2081E439} - {170F33B5-C7C4-4D97-8DB9-DE508E2DFCD0} = {A0B29205-19C3-4FF8-B3A0-28E9E9182E86} - {78E23FC2-A337-4FC2-AEBF-CDC517AEA30C} = {8635B709-1D5A-4445-AC45-F99EE264634F} - {06700271-27A1-4236-9AB3-B45CE431FE0C} = {78E23FC2-A337-4FC2-AEBF-CDC517AEA30C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D6A9B467-ED50-40DB-9FFB-5BE745F08DDB} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/IAppenderServiceProvider.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/IAppenderServiceProvider.cs deleted file mode 100644 index 17380ea..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/IAppenderServiceProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace log4net.Appender; - -internal interface IAppenderServiceProvider -{ - IServiceProvider ServiceProvider { set; } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/ServiceAppenderSkeleton.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/ServiceAppenderSkeleton.cs deleted file mode 100644 index f85cb69..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Appenders/ServiceAppenderSkeleton.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace log4net.Appender; - -public abstract class ServiceAppenderSkeleton : AppenderSkeleton, IAppenderServiceProvider, IDisposable -{ - private IServiceProvider _serviceProvider; - IServiceProvider IAppenderServiceProvider.ServiceProvider { set => _serviceProvider = value; } - - protected T ResolveService() where T : class - { - if (_serviceProvider == null) - return default; - - return _serviceProvider.GetService(); - } - - public void Dispose() => _serviceProvider = null; -} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/EventIDLogImpl.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/EventIDLogImpl.cs deleted file mode 100644 index b8929e9..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/EventIDLogImpl.cs +++ /dev/null @@ -1,22 +0,0 @@ -using log4net.Core; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; - -// ref: http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/2.0/Extensibility/EventIDLogApp/cs/src/ -public class EventIDLogImpl : LogImpl, IEventIDLog -{ - public EventIDLogImpl(log4net.Core.ILogger logger) : base(logger) { /* skip */ } - - #region Implementation of IEventIDLog - - public void Log(EventId eventId, LoggingEvent loggingEvent) - { - // is the EventId empty? - if (!(eventId.Id == 0 && string.IsNullOrWhiteSpace(eventId.Name))) - loggingEvent.Properties[nameof(EventId)] = eventId; - - Logger.Log(loggingEvent); - } - - #endregion -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/IEventIDLog .cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/IEventIDLog .cs deleted file mode 100644 index 966ff7c..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/IEventIDLog .cs +++ /dev/null @@ -1,9 +0,0 @@ -using log4net; -using log4net.Core; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; - -public interface IEventIDLog : ILog -{ - void Log(EventId eventId, LoggingEvent loggingEvent); -} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/MessageCandidate.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/MessageCandidate.cs deleted file mode 100644 index af2fb62..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/MessageCandidate.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities -{ - /// - /// Represents a candidate for a log message that should be printed. This candidate will either be accepted or denied by the logger that is trying to print it. - /// - /// - /// - /// This is a readonly struct to reduce memory pressure, but because it is quite large (definitly larger than the recommended 16 bytes) - /// it needs to be passed as a reference (with the in keyword) to make a difference. - /// - /// - /// See for more information. - /// - /// - /// Type of the state that is used to format the error message. - public readonly struct MessageCandidate - { - public MessageCandidate(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) - { - State = state; - LogLevel = logLevel; - EventId = eventId; - Exception = exception; - Formatter = formatter; - } - - /// - /// The log level the message should be printed with. - /// - public LogLevel LogLevel { get; } - - /// - /// The event id of the message. - /// - public EventId EventId { get; } - - /// - /// The message state. Can be provided to the formatter to generate the string representation of the error message. - /// - public TState State { get; } - - /// - /// Exception that should be printed with the message. Null if the log message has no corrosponding exception. - /// - public Exception Exception { get; } - - /// - /// The message formatter. Can be called with the state and exception to generate the string representation of the error message. - /// - public Func Formatter { get; } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/NodeInfo.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/NodeInfo.cs deleted file mode 100644 index fa5ceb5..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Entities/NodeInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities -{ - /// - /// Class to store information of a log4net xml config file node. - /// - public class NodeInfo - { - /// - /// Gets or sets the x path to find the node to override. - /// - /// - /// The x path. - /// - public string XPath { get; set; } - - /// - /// Gets or sets the content of the node. - /// - /// - /// The content of the node. - /// - public string NodeContent { get; set; } - - /// - /// Gets or sets the attributes. - /// - /// - /// The attributes. - /// - public Dictionary Attributes { get; set; } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/DocumentExtensions.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/DocumentExtensions.cs deleted file mode 100644 index 34b3b78..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/DocumentExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.IO; -using System.Xml; -using System.Xml.Linq; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Extensions -{ - /// - /// Class with XmlDocument and XDocument extensions. - /// - internal static class DocumentExtensions - { - /// - /// Converts a XmlDocument object into xDocument. - /// - /// The XML document. - /// The XmlDocument converted to XDocument - public static XDocument ToXDocument(this XmlDocument xmlDocument) - { - using (var memoryStream = new MemoryStream()) - { - xmlDocument.Save(memoryStream); - memoryStream.Seek(0, SeekOrigin.Begin); - return XDocument.Load(memoryStream); - } - } - - /// - /// Converts a XDocument object into XmlDocument - /// - /// The x document. - /// The XDocument converted to XmlDocument - public static XmlDocument ToXmlDocument(this XDocument xDocument) - { - using (var memoryStream = new MemoryStream()) - { - xDocument.Save(memoryStream); - memoryStream.Seek(0, SeekOrigin.Begin); - var xmlDoc = new XmlDocument(); - xmlDoc.Load(memoryStream); - return xmlDoc; - } - } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/Log4NetProviderExtensions.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/Log4NetProviderExtensions.cs deleted file mode 100644 index 2fbabb9..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/Log4NetProviderExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using log4net; -using System; -using System.Reflection; - -namespace Microsoft.Extensions.Logging.Extensions -{ - /// - /// Log4Net provider extensions. - /// - public static class Log4NetProviderExtensions - { - /// - /// Creates a logger with the name of the given type. - /// - /// The type of the class to be used as name of the logger. - /// An ILoggerProvider instance. - /// An instance of the . - public static ILogger CreateLogger(this ILoggerProvider self) where TName : class - { - if (self == null) - { - throw new ArgumentNullException(nameof(self)); - } - - if (!self.GetType().IsAssignableFrom(typeof(Log4NetProvider))) - { - throw new ArgumentOutOfRangeException(nameof(self), "The ILoggerProvider should be of type Log4NetProvider."); - } - - return self.CreateLogger(typeof(TName).FullName); - } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/LogExtensions.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/LogExtensions.cs deleted file mode 100644 index 5ea259f..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Extensions/LogExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using log4net; -using System; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Extensions -{ - /// - /// The class. - /// - public static class LogExtensions - { - /// - /// Criticals the specified message. - /// - /// The log. - /// The message. - /// The exception. - public static void Critical(this ILog log, object message, Exception exception) - => log.Logger.Log(null, log4net.Core.Level.Critical, message, exception); - - /// - /// Traces the specified message. - /// - /// The log. - /// The message. - /// The exception. - public static void Trace(this ILog log, object message, Exception exception) - => log.Logger.Log(null, log4net.Core.Level.Trace, message, exception); - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLogLevelTranslator.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLogLevelTranslator.cs deleted file mode 100644 index 9bd80d8..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLogLevelTranslator.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Microsoft.Extensions.Logging -{ - /// - /// Represents a log level translator between the different logging systems. - /// - public interface ILog4NetLogLevelTranslator - { - /// - /// Translates a to a log4net based on the provided options. - /// - /// The log level to translate. - /// The log4net provider options influencing the translation. - /// The corresponding log level for log4net. - log4net.Core.Level TranslateLogLevel(LogLevel logLevel, Log4NetProviderOptions options); - } -} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLoggingEventFactory.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLoggingEventFactory.cs deleted file mode 100644 index 7e3dd42..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/ILog4NetLoggingEventFactory.cs +++ /dev/null @@ -1,25 +0,0 @@ -using log4net.Core; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; - -namespace Microsoft.Extensions.Logging -{ - /// - /// Represents a factory that creates the log4net from a . - /// - public interface ILog4NetLoggingEventFactory - { - /// - /// Create the . - /// - /// Type of the state object that is used to format the log message. - /// The message information that should be logged. - /// The logger the event is created for. - /// The options of the log4net logging provider. - /// A that is ready to be logged with the provided logger or null if the candidate should be dropped. - LoggingEvent CreateLoggingEvent( - in MessageCandidate messageCandidate, - log4net.Core.ILogger logger, - Log4NetProviderOptions options, - IExternalScopeProvider scopeProvider); - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/LICENSE b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetExtensions.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetExtensions.cs deleted file mode 100644 index 3d7250e..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetExtensions.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; - -namespace Microsoft.Extensions.Logging -{ - /// - /// The log4net extensions class. - /// - public static class Log4NetExtensions - { - /// - /// Adds the log4net. - /// - /// The factory. - /// The with added Log4Net provider - public static ILoggerFactory AddLog4Net(this ILoggerFactory factory) - => factory.AddLog4Net(new Log4NetProviderOptions()); - - /// - /// Adds the log4net. - /// - /// The factory. - /// The log4net Config File. - /// The after adding the log4net provider. - public static ILoggerFactory AddLog4Net(this ILoggerFactory factory, string log4NetConfigFile) - => factory.AddLog4Net(log4NetConfigFile, false); - - /// - /// Adds the log4net logging provider. - /// - /// The factory. - /// The log4 net configuration file. - /// if set to true [watch]. - /// The after adding the log4net provider. - public static ILoggerFactory AddLog4Net(this ILoggerFactory factory, string log4NetConfigFile, bool watch) - => factory.AddLog4Net(new Log4NetProviderOptions(log4NetConfigFile, watch)); - - /// - /// Adds the log4net logging provider. - /// - /// The logger factory. - /// The options for log4net provider. - /// The after adding the log4net provider. - public static ILoggerFactory AddLog4Net(this ILoggerFactory factory, Log4NetProviderOptions options) - { - factory.AddProvider(new Log4NetProvider(options)); - return factory; - } - - /// - /// Adds the log4net logging provider. - /// - /// The logging builder instance. - /// The passed as parameter with the new provider registered. - public static ILoggingBuilder AddLog4Net(this ILoggingBuilder builder) - { - var options = new Log4NetProviderOptions(); - return builder.AddLog4Net(options); - } - - /// - /// Adds the log4net logging provider. - /// - /// The logging builder instance. - /// The log4net Config File. - /// The passed as parameter with the new provider registered. - public static ILoggingBuilder AddLog4Net(this ILoggingBuilder builder, string log4NetConfigFile) - { - var options = new Log4NetProviderOptions(log4NetConfigFile); - return builder.AddLog4Net(options); - } - - /// - /// Adds the log4net logging provider. - /// - /// The logging builder instance. - /// The log4net Config File. - /// if set to true, the configuration will be reloaded when the xml configuration file changes. - /// - /// The passed as parameter with the new provider registered. - /// - public static ILoggingBuilder AddLog4Net(this ILoggingBuilder builder, string log4NetConfigFile, bool watch) - { - var options = new Log4NetProviderOptions(log4NetConfigFile, watch); - return builder.AddLog4Net(options); - } - - /// - /// Adds the log4net logging provider. - /// - /// The logging builder instance. - /// The options. - /// The passed as parameter with the new provider registered. - public static ILoggingBuilder AddLog4Net(this ILoggingBuilder builder, Log4NetProviderOptions options) - { - builder.Services.Replace(ServiceDescriptor.Singleton(sp => new Log4NetProvider(options, sp))); - return builder; - } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogLevelTranslator.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogLevelTranslator.cs deleted file mode 100644 index 7da1de2..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogLevelTranslator.cs +++ /dev/null @@ -1,42 +0,0 @@ -using log4net.Core; -using System; - -namespace Microsoft.Extensions.Logging -{ - /// - public sealed class Log4NetLogLevelTranslator : ILog4NetLogLevelTranslator - { - /// - public Level TranslateLogLevel(LogLevel logLevel, Log4NetProviderOptions options) - { - Level log4NetLevel = null; - switch (logLevel) - { - case LogLevel.Critical: - string overrideCriticalLevelWith = options.OverrideCriticalLevelWith; - log4NetLevel = !string.IsNullOrEmpty(overrideCriticalLevelWith) - && overrideCriticalLevelWith.Equals(LogLevel.Critical.ToString(), StringComparison.OrdinalIgnoreCase) - ? Level.Critical - : Level.Fatal; - break; - case LogLevel.Debug: - log4NetLevel = Level.Debug; - break; - case LogLevel.Error: - log4NetLevel = Level.Error; - break; - case LogLevel.Information: - log4NetLevel = Level.Info; - break; - case LogLevel.Warning: - log4NetLevel = Level.Warn; - break; - case LogLevel.Trace: - log4NetLevel = Level.Trace; - break; - } - - return log4NetLevel; - } - } -} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogger.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogger.cs deleted file mode 100644 index cc67b91..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLogger.cs +++ /dev/null @@ -1,124 +0,0 @@ -using log4net; -using log4net.Core; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; -using System; - -namespace Microsoft.Extensions.Logging -{ - /// - /// The log4net eventIdLogger class. - /// - public class Log4NetLogger : ILogger - { - private readonly IExternalScopeProvider externalScopeProvider; - - /// - /// The log. - /// - private readonly IEventIDLog eventIdLogger; - - /// - /// The provider options. - /// - private readonly Log4NetProviderOptions options; - - /// - /// Initializes a new instance of the class. - /// - /// The log4net provider options. - public Log4NetLogger(Log4NetProviderOptions options, IExternalScopeProvider externalScopeProvider) - { - this.options = options ?? throw new ArgumentNullException(nameof(options)); - this.externalScopeProvider = externalScopeProvider ?? throw new ArgumentNullException(nameof(externalScopeProvider)); - this.eventIdLogger = new EventIDLogImpl(LogManager.GetLogger(options.LoggerRepository, options.Name).Logger); - } - - /// - /// Gets the name. - /// - public string Name - => this.eventIdLogger.Logger.Name; - - /// - /// A get-only property for accessing the - /// within the instance. - /// - internal Log4NetProviderOptions Options => this.options; - - - /// - /// Begins a logical operation scope. - /// - /// The type of the state. - /// The identifier for the scope. - /// - /// An IDisposable that ends the logical operation scope on dispose. - /// - public IDisposable BeginScope(TState state) - => externalScopeProvider.Push(state); - - /// - /// Determines whether the logging level is enabled. - /// - /// The log level. - /// The value indicating whether the logging level is enabled. - /// Throws when is outside allowed range. - public bool IsEnabled(LogLevel logLevel) - { - Level translatedLogLevel = this.options.LogLevelTranslator.TranslateLogLevel(logLevel, Options); - if (translatedLogLevel != null) - { - return this.eventIdLogger.Logger.IsEnabledFor(translatedLogLevel); - } - - if (logLevel == LogLevel.None) - { - return false; - } - - throw new ArgumentOutOfRangeException(nameof(logLevel)); - } - - /// - /// Logs an exception into the log. - /// - /// The log level. - /// The event Id. - /// The state. - /// The exception. - /// The formatter. - /// The type of the state. - /// Throws when the is null. - public void Log( - LogLevel logLevel, - EventId eventId, - TState state, - Exception exception, - Func formatter) - { - if (!this.IsEnabled(logLevel)) - { - return; - } - - EnsureValidFormatter(formatter); - - var candidate = new MessageCandidate(logLevel, eventId, state, exception, formatter); - - LoggingEvent loggingEvent = options.LoggingEventFactory.CreateLoggingEvent(in candidate, eventIdLogger.Logger, options, externalScopeProvider); - - if (loggingEvent == null) - return; - - this.eventIdLogger.Log(eventId, loggingEvent); - } - - private static void EnsureValidFormatter(Func formatter) - { - if (formatter == null) - { - throw new ArgumentNullException(nameof(formatter)); - } - } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLoggingEventFactory.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLoggingEventFactory.cs deleted file mode 100644 index 94cca77..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetLoggingEventFactory.cs +++ /dev/null @@ -1,140 +0,0 @@ -using log4net.Core; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; - -namespace Microsoft.Extensions.Logging -{ - /// - public class Log4NetLoggingEventFactory - : ILog4NetLoggingEventFactory - { - /// - /// The default property name for scopes that don't provide their own property name by implementing - /// an where T is and where TKey - /// is . - /// - protected const string DefaultScopeProperty = "scope"; - - /// - public LoggingEvent CreateLoggingEvent( - in MessageCandidate messageCandidate, - log4net.Core.ILogger logger, - Log4NetProviderOptions options, - IExternalScopeProvider scopeProvider) - { - Type callerStackBoundaryDeclaringType = typeof(LoggerExtensions); - string message = messageCandidate.Formatter(messageCandidate.State, messageCandidate.Exception); - Level logLevel = options.LogLevelTranslator.TranslateLogLevel(messageCandidate.LogLevel, options); - - if (logLevel == null || (string.IsNullOrEmpty(message) && messageCandidate.Exception == null)) - return null; - - var loggingEvent = new LoggingEvent( - callerStackBoundaryDeclaringType: callerStackBoundaryDeclaringType, - repository: logger.Repository, - loggerName: logger.Name, - level: logLevel, - message: message, - exception: messageCandidate.Exception); - - // ref: https://github.com/huorswords/Microsoft.Extensions.Logging.Log4Net.AspNetCore/pull/126/commits/1ad3d429afb4417947863d1bc37231bf7a457f3c - - if (messageCandidate.State is IEnumerable> formattedLogValues) - { - foreach (var pair in formattedLogValues) - { - loggingEvent.Properties[pair.Key] = pair.Value; - } - } - - EnrichWithScopes(loggingEvent, scopeProvider); - - return loggingEvent; - } - - - /// - /// Gets the scopes from the external scope provider and converts them to the properties on the logging event. - /// This function will honor the convention that logging scopes can provide their own property name, by implementing - /// an where T is and where TKey is - /// . - /// - /// - /// The default implementation will call Convert.ToString(scope, CultureInfo.InvariantCulture) on all scope objects. - /// If you want to do this conversion inside the Log4Net Pipeline, e. g. with a custom layout, you can override this - /// method and change the behaviour. - /// - /// The the scope information will be added to. - /// The external provider for the current logging scope. - protected virtual void EnrichWithScopes(LoggingEvent loggingEvent, IExternalScopeProvider scopeProvider) - { - scopeProvider.ForEachScope((scope, @event) => - { - // This function will add the scopes in the legacy way they were added before the IExternalScopeProvider was introduced, - // to maintain backwards compatibility. - // This pretty much means that we are emulating a LogicalThreadContextStack, which is a stack, that allows pushing - // strings on to it, which will be concatenated with space as a separator. - // See: https://github.com/apache/logging-log4net/blob/47aaf46d5f031ea29d781bac4617bd1bb9446215/src/log4net/Util/LogicalThreadContextStack.cs#L343 - - // Because string implements IEnumerable we first need to check for string. - if (scope is string) - { - string previousValue = @event.Properties[DefaultScopeProperty] as string; - - @event.Properties[DefaultScopeProperty] = JoinOldAndNewValue(previousValue, scope.ToString()); - return; - } - - if (scope is IEnumerable col) - { - foreach (var item in col) - { - if (item is KeyValuePair) - { - var keyValuePair = (KeyValuePair)item; - string previousValue = @event.Properties[keyValuePair.Key] as string; - @event.Properties[keyValuePair.Key] = JoinOldAndNewValue(previousValue, keyValuePair.Value); - continue; - } - - if (item is KeyValuePair) - { - var keyValuePair = (KeyValuePair)item; - string previousValue = @event.Properties[keyValuePair.Key] as string; - - // The current culture should not influence how integers/floats/... are displayed in logging, - // so we are using Convert.ToString which will convert IConvertible and IFormattable with - // the specified IFormatProvider. - string additionalValue = Convert.ToString(keyValuePair.Value, CultureInfo.InvariantCulture); - @event.Properties[keyValuePair.Key] = JoinOldAndNewValue(previousValue, additionalValue); - continue; - } - } - return; - } - - if (scope is object) - { - string previousValue = @event.Properties[DefaultScopeProperty] as string; - string additionalValue = Convert.ToString(scope, CultureInfo.InvariantCulture); - @event.Properties[DefaultScopeProperty] = JoinOldAndNewValue(previousValue, additionalValue); - return; - } - - }, loggingEvent); - } - - private static string JoinOldAndNewValue(string previousValue, string newValue) - { - if (string.IsNullOrEmpty(previousValue)) - { - return newValue; - } - - return previousValue + " " + newValue; - } - } -} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProvider.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProvider.cs deleted file mode 100644 index 11e9905..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProvider.cs +++ /dev/null @@ -1,469 +0,0 @@ -using log4net; -using log4net.Config; -using log4net.Repository; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Extensions; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Scope; -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Xml; -using System.Xml.Linq; -using System.Xml.XPath; -using log4net.Appender; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Logging -{ - /// - /// The log4net provider class. - /// - /// - public class Log4NetProvider : ILoggerProvider, ISupportExternalScope - { - /// - /// The loggers collection. - /// - private readonly ConcurrentDictionary loggers = new ConcurrentDictionary(); - - /// - /// Prevents to dispose the object more than single time. - /// - private bool disposedValue = false; - - /// - /// The log4net repository. - /// - public ILoggerRepository Repository; - - /// - /// The provider options. - /// - private Log4NetProviderOptions options; - - /// - /// The external logging scope provider. - /// - /// - /// Reading the offical logging implementations, it seems like we need to handle the case that this might never be set. - /// We handle it with a NullScopeProvider instead of null checks, to make the process of implementing interfaces like - /// less error prone for consumers. - /// - public IExternalScopeProvider ExternalScopeProvider { get; private set; } = NullScopeProvider.Instance; - - /// - /// Initializes a new instance of the class. - /// - public Log4NetProvider() - : this(new Log4NetProviderOptions()) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The log4NetConfigFile. - public Log4NetProvider(string log4NetConfigFileName) - : this(new Log4NetProviderOptions(log4NetConfigFileName)) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The options. - /// options - /// Wach cannot be true when you are overwriting config file values with values from configuration section. - public Log4NetProvider(Log4NetProviderOptions options) - { - this.SetOptionsIfValid(options); - - Assembly loggingAssembly = GetLoggingReferenceAssembly(); - - this.CreateLoggerRepository(loggingAssembly) - .ConfigureLog4NetLibrary(loggingAssembly); - } - - #region IOC implementation - - /// - /// Initializes a new instance of the class. - /// - /// A reference to the IOC service collection. - public Log4NetProvider(IServiceProvider serviceCollection) - : this(new Log4NetProviderOptions(), serviceCollection) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The log4NetConfigFile. - /// A reference to the IOC service collection. - public Log4NetProvider(string log4NetConfigFileName, IServiceProvider serviceProvider) - : this(new Log4NetProviderOptions(log4NetConfigFileName), serviceProvider) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The options. - /// A reference to the IOC service collection. - /// options - /// Watch cannot be true when you are overwriting config file values with values from configuration section. - public Log4NetProvider(Log4NetProviderOptions options, IServiceProvider serviceProvider) - { - this.serviceProvider = serviceProvider; - - this.SetOptionsIfValid(options); - - Assembly loggingAssembly = GetLoggingReferenceAssembly(); - - this.CreateLoggerRepository(loggingAssembly) - .ConfigureLog4NetLibrary(loggingAssembly); - } - - /// - /// Holds a reference to the IOC Service Provider - /// - private IServiceProvider serviceProvider; - - #endregion - - /// - /// Finalizes the instance of the object. - /// - ~Log4NetProvider() - { - Dispose(false); - } - - /// - /// Creates the logger. - /// - /// An instance of the . - public ILogger CreateLogger() - => this.CreateLogger(this.options.Name); - - /// - /// Creates the logger. - /// - /// The category name. - /// An instance of the . - public ILogger CreateLogger(string categoryName) - => this.loggers.GetOrAdd(categoryName, this.CreateLoggerImplementation); - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - this.Repository.Shutdown(); - this.loggers.Clear(); - - serviceProvider = null; - } - - disposedValue = true; - } - } - - /// - /// Updates configuration nodes overriding values if required. - /// - /// The configuration file XML document. - /// The overriding values available - /// An within the overriding values replaced. - private static XmlDocument UpdateNodesWithOverridingValues(XmlDocument configXmlDocument, IEnumerable overridingNodes) - { - var additionalConfig = overridingNodes; - if (additionalConfig != null) - { - var configXDoc = configXmlDocument.ToXDocument(); - foreach (var nodeInfo in additionalConfig) - { - var node = configXDoc.XPathSelectElement(nodeInfo.XPath); - if (node != null) - { - if (nodeInfo.NodeContent != null) - { - node.Value = nodeInfo.NodeContent; - } - - AddOrUpdateAttributes(node, nodeInfo); - } - } - - return configXDoc.ToXmlDocument(); - } - - return configXmlDocument; - } - - /// - /// Adds or updates the attributes specified in the node information. - /// - /// The node. - /// The node information. - private static void AddOrUpdateAttributes(XElement node, NodeInfo nodeInfo) - { - if (nodeInfo?.Attributes != null) - { - foreach (var attribute in nodeInfo.Attributes) - { - var nodeAttribute = node.Attributes() - .FirstOrDefault(a => a.Name.LocalName.Equals(attribute.Key, StringComparison.OrdinalIgnoreCase)); - if (nodeAttribute != null) - { - nodeAttribute.Value = attribute.Value; - } - else - { - node.SetAttributeValue(attribute.Key, attribute.Value); - } - } - } - } - - /// - /// Parses log4net config file. - /// - /// The filename. - /// The with the log4net XML element. - private static XmlDocument ParseLog4NetConfigFile(string filename) - { - using (FileStream stream = File.OpenRead(filename)) - { - var settings = new XmlReaderSettings - { - DtdProcessing = DtdProcessing.Prohibit - }; - - var log4netConfig = new XmlDocument(); - using (var reader = XmlReader.Create(stream, settings)) - { - log4netConfig.Load(reader); - } - - return log4netConfig; - } - } - - /// - /// Tries to retrieve the assembly from a "Startup" type found in the stack trace. - /// - /// Null for NetCoreApp 1.1, otherwise, Assembly of Startup type if found in stack trace. - private static Assembly GetCallingAssemblyFromStartup() - { - var stackTrace = new System.Diagnostics.StackTrace(2); - - for (int i = 0; i < stackTrace.FrameCount; i++) - { - var frame = stackTrace.GetFrame(i); - var type = frame.GetMethod()?.DeclaringType; - - if (string.Equals(type?.Name, "Startup", StringComparison.OrdinalIgnoreCase)) - { - return type.Assembly; - } - } - - return null; - } - - /// - /// Creates the logger implementation. - /// - /// The name. - /// The instance. - private Log4NetLogger CreateLoggerImplementation(string name) - { - var loggerOptions = new Log4NetProviderOptions - { - Name = name, - LoggerRepository = this.Repository.Name, - OverrideCriticalLevelWith = this.options.OverrideCriticalLevelWith, - LoggingEventFactory = this.options.LoggingEventFactory ?? new Log4NetLoggingEventFactory(), - LogLevelTranslator = this.options.LogLevelTranslator ?? new Log4NetLogLevelTranslator(), - }; - - return new Log4NetLogger(loggerOptions, ExternalScopeProvider); - } - - /// - /// Gets the current executing assembly considering the target framework. - /// - /// The assembly to be used as the reference logging assembly. - private static Assembly GetLoggingReferenceAssembly() - { - Assembly assembly = null; - - assembly = Assembly.GetExecutingAssembly(); - - return assembly ?? GetCallingAssemblyFromStartup(); - } - - /// - /// Ensures that provided options combinations are valid, and sets the class field if everything is ok. - /// - /// The options to validate. - /// - /// Throws when the Watch option is set and there are properties to override. - /// - /// - /// Throws when the options parameter is null. - /// - private void SetOptionsIfValid(Log4NetProviderOptions options) - { - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - if (options.Watch - && options.PropertyOverrides.Any()) - { - throw new NotSupportedException("Wach cannot be true when you are overwriting config file values with values from configuration section."); - } - - this.options = options; - } - - /// - /// Configures the log4net library using the available configuration data. - /// - /// The assembly to be used on the configuration. - private Log4NetProvider ConfigureLog4NetLibrary(Assembly assembly) - { - if (this.options.UseWebOrAppConfig) - { - XmlConfigurator.Configure(this.Repository); - return this; - } - - if (!this.options.ExternalConfigurationSetup) - { - string fileNamePath = CreateLog4NetFilePath(assembly); - if (this.options.Watch) - { - XmlConfigurator.ConfigureAndWatch( - this.Repository, - new FileInfo(fileNamePath)); - } - else - { - var configXml = ParseLog4NetConfigFile(fileNamePath); - if (this.options.PropertyOverrides != null - && this.options.PropertyOverrides.Any()) - { - configXml = UpdateNodesWithOverridingValues( - configXml, - this.options.PropertyOverrides); - } - - XmlConfigurator.Configure(this.Repository, configXml.DocumentElement); - } - } - - this.InjectServices(); - - return this; - } - - /// - /// Wires up specific adapters for IOC support - /// - private void InjectServices() - { - if (this.Repository is null) - return; - - IEnumerable adapters = - this.Repository - .GetAppenders() - .OfType(); - - foreach (IAppenderServiceProvider adapter in adapters) - adapter.ServiceProvider = serviceProvider; - } - - /// - /// Creates the log4net.config file path. - /// - /// The assembly to be used when the configuration indicate to use the current assembly. - /// The full path to the log4net.config file. - private string CreateLog4NetFilePath(Assembly assembly) - { - string fileNamePath = this.options.Log4NetConfigFileName; - if (!Path.IsPathRooted(fileNamePath)) - { - fileNamePath = Path.Combine(AppContext.BaseDirectory, fileNamePath); - } - - return Path.GetFullPath(fileNamePath); - } - - /// - /// Gets or creates the logger repository using the given assembly. - /// - /// The assembly to be used to create de repository. - private Log4NetProvider CreateLoggerRepository(Assembly assembly) - { - Type repositoryType = typeof(log4net.Repository.Hierarchy.Hierarchy); - - if (!string.IsNullOrEmpty(this.options.LoggerRepository)) - { - try - { - this.Repository = LogManager.GetRepository(this.options.LoggerRepository); - if (this.options.ExternalConfigurationSetup) - { - // The logger repository is already configured. We can exit here. - return this; - } - } - catch (log4net.Core.LogException) - { - // The logger repository is not defined outside the extension. - this.Repository = null; - } - - if (this.Repository == null) - { - this.Repository = - LogManager.CreateRepository(this.options.LoggerRepository, repositoryType); - } - } - else - { - this.Repository = - LogManager.CreateRepository(assembly, repositoryType); - } - - return this; - } - - public void SetScopeProvider(IExternalScopeProvider scopeProvider) - { - ExternalScopeProvider = scopeProvider; - } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProviderOptions.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProviderOptions.cs deleted file mode 100644 index 6c020a7..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Log4NetProviderOptions.cs +++ /dev/null @@ -1,99 +0,0 @@ -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Entities; -using Microsoft.Extensions.Logging.Log4Net.AspNetCore.Scope; -using System.Collections.Generic; - -namespace Microsoft.Extensions.Logging -{ - /// - /// The log4Net provider options. - /// - public sealed class Log4NetProviderOptions - { - /// - /// The default log4 net file name - /// - private const string DefaultLog4NetFileName = "log4net.config"; - - /// - /// Initializes a new instance of the class. - /// - public Log4NetProviderOptions() - : this(DefaultLog4NetFileName) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// Name of the log4 net configuration file. - public Log4NetProviderOptions(string log4NetConfigFileName) - : this(log4NetConfigFileName, false) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// Name of the log4net configuration file. - public Log4NetProviderOptions(string log4NetConfigFileName, bool watch) - { - this.Log4NetConfigFileName = log4NetConfigFileName; - this.Watch = watch; - - this.OverrideCriticalLevelWith = string.Empty; - this.Name = string.Empty; - this.PropertyOverrides = new List(); - this.ExternalConfigurationSetup = false; - } - - /// - /// Gets or sets the name. - /// - public string Name { get; set; } - - /// - /// Gets or sets the name of the log file. - /// - public string Log4NetConfigFileName { get; set; } - - /// - /// Gets or sets the logger repository. - /// - public string LoggerRepository { get; set; } - - /// - /// Gets or sets the level value that should be used to override default's critical level. - /// - public string OverrideCriticalLevelWith { get; set; } - - /// - /// Gets or sets the property overrides. - /// - public List PropertyOverrides { get; set; } - - /// - /// Gets or sets a value indicating whether this is watch. - /// - public bool Watch { get; set; } - - /// - /// Let user setup log4net externally - /// - public bool ExternalConfigurationSetup { get; set; } - - /// - /// Let user setup log4net from web.config / app.config. - /// - public bool UseWebOrAppConfig { get; set; } - - /// - /// Gets or sets the factory for the log4net ."/>. - /// - public ILog4NetLoggingEventFactory LoggingEventFactory { get; set; } - - /// - /// Gets or sets the translator between the and the log4net . - /// - public ILog4NetLogLevelTranslator LogLevelTranslator { get; set; } - } -} \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Microsoft.Extensions.Logging.Log4Net.AspNetCore.csproj b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Microsoft.Extensions.Logging.Log4Net.AspNetCore.csproj deleted file mode 100644 index e4568dd..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Microsoft.Extensions.Logging.Log4Net.AspNetCore.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - net7.0 - - - True - False - Microsoft.Extensions.Logging.Log4Net.AspNetCore - Huor Swords - - Microsoft.Extensions.Logging.Log4Net.AspNetCore - - Allows to configure Log4net as Microsoft Extensions Logging handler on any ASP.NET Core application. - - Original code proposal by @anuraj --> https://dotnetthoughts.net/how-to-use-log4net-with-aspnetcore-for-logging/ - - - Microsoft Extensions Logging Log4Net AspNet Core - Microsoft.Extensions.Logging.Log4Net.AspNetCore - Microsoft.Extensions.Logging.Log4Net.AspNetCore - #113 - BeginScope don't work as expected -# BREAKING CHANGES -* External scope can't be used with the scope factories anymore. -* Conversion of numeric values now are managed through CultureInfo.InvariantCulture - - https://github.com/huorswords/Microsoft.Extensions.Logging.Log4Net.AspNetCore - https://github.com/huorswords/Microsoft.Extensions.Logging.Log4Net.AspNetCore - 7.1.0 - 7.1.0.0 - 7.1.0.0 - true - Microsoft.Extensions.Logging.Log4Net.AspNetCoreKey.snk - - LICENSE - - - true - snupkg - - - - - - - - - - - - - - - - - True - - - - \ No newline at end of file diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScope.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScope.cs deleted file mode 100644 index 1c1198f..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScope.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Scope -{ - /// - /// A logger scope that does not save any information and does not need to be disposed. - /// - internal class NullScope : IDisposable - { - /// - /// The singleton instance that represent every . - /// - internal static NullScope Instance { get; } = new NullScope(); - - /// - /// Constructor that prevents external instantiation. - /// - private NullScope() - { - } - - /// - public void Dispose() - { - // This is a null scope so we need to dispose nothing. - } - } -} diff --git a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScopeProvider.cs b/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScopeProvider.cs deleted file mode 100644 index 18ea0dc..0000000 --- a/Resources/3rd Party/Microsoft.Extensions.Logging.Log4Net.AspNetCore/Scope/NullScopeProvider.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -namespace Microsoft.Extensions.Logging.Log4Net.AspNetCore.Scope -{ - /// - /// A that will not save nor return scopes. - /// - internal class NullScopeProvider : IExternalScopeProvider - { - /// - /// The singleton instance that represents every . - /// - internal static NullScopeProvider Instance { get; } = new NullScopeProvider(); - - /// - /// Constructor that prevents external instantiation. - /// - private NullScopeProvider() - { - } - - /// - public void ForEachScope(Action callback, TState state) - { - // All scopes are null scopes so do nothing. - } - - /// - public IDisposable Push(object state) - { - return NullScope.Instance; - } - } -}