From 97365fcf8373a61fccc26151145ae6f54a7e4b7a Mon Sep 17 00:00:00 2001 From: Rolf Kristensen Date: Wed, 29 Jan 2025 18:28:19 +0100 Subject: [PATCH] Castle.Services.Logging.DiagnosticsLogger for Windows EventLog --- Castle.Core.sln | 11 +++++- .../Castle.Core.Tests.WeakNamed.csproj | 3 +- .../Castle.Core.Tests.csproj | 3 ++ src/Castle.Core.Tests/PublicApiTestCase.cs | 1 + .../DiagnosticsLoggerTestCase.cs | 0 src/Castle.Core/Castle.Core.csproj | 8 ---- ....Services.Logging.DiagnosticsLogger.csproj | 39 +++++++++++++++++++ .../DiagnosticsLogger.cs | 2 +- .../DiagnosticsLoggerFactory.cs | 2 +- 9 files changed, 56 insertions(+), 13 deletions(-) rename src/Castle.Core.Tests/{Core.Tests/Logging => Services.Logging.Tests/DiagnosticLogger}/DiagnosticsLoggerTestCase.cs (100%) create mode 100644 src/Castle.Services.Logging.DiagnosticsLogger/Castle.Services.Logging.DiagnosticsLogger.csproj rename src/{Castle.Core/Core/Logging => Castle.Services.Logging.DiagnosticsLogger}/DiagnosticsLogger.cs (98%) rename src/{Castle.Core/Core/Logging => Castle.Services.Logging.DiagnosticsLogger}/DiagnosticsLoggerFactory.cs (94%) diff --git a/Castle.Core.sln b/Castle.Core.sln index 5f1450a217..fa4a70e7b9 100644 --- a/Castle.Core.sln +++ b/Castle.Core.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30011.22 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35312.102 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Build", "Castle Build", "{1B999D24-B7AB-4997-96E7-08FA05325694}" ProjectSection(SolutionItems) = preProject @@ -37,6 +37,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Ac .github\workflows\build.yml = .github\workflows\build.yml EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Castle.Services.Logging.DiagnosticsLogger", "src\Castle.Services.Logging.DiagnosticsLogger\Castle.Services.Logging.DiagnosticsLogger.csproj", "{B200E568-EBF4-42DB-86D0-94C1BC1055E1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -67,6 +69,10 @@ Global {14D86762-CF9B-4560-80C9-10C16DBE246C}.Debug|Any CPU.Build.0 = Debug|Any CPU {14D86762-CF9B-4560-80C9-10C16DBE246C}.Release|Any CPU.ActiveCfg = Release|Any CPU {14D86762-CF9B-4560-80C9-10C16DBE246C}.Release|Any CPU.Build.0 = Release|Any CPU + {B200E568-EBF4-42DB-86D0-94C1BC1055E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B200E568-EBF4-42DB-86D0-94C1BC1055E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B200E568-EBF4-42DB-86D0-94C1BC1055E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B200E568-EBF4-42DB-86D0-94C1BC1055E1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -76,6 +82,7 @@ Global {344D907D-6641-4A61-94C2-4980B5804FE2} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E} {91B2A82F-63F6-46B1-8EDC-5D029BCF6A2B} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E} {149DB291-CBD6-4F82-A6A6-758E328DB946} = {1B999D24-B7AB-4997-96E7-08FA05325694} + {B200E568-EBF4-42DB-86D0-94C1BC1055E1} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {682D4399-4863-4813-B495-5FEDD22496ED} diff --git a/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj b/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj index 36e49b7ceb..96c12a9829 100644 --- a/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj +++ b/src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj @@ -1,4 +1,4 @@ - + @@ -29,6 +29,7 @@ + diff --git a/src/Castle.Core.Tests/Castle.Core.Tests.csproj b/src/Castle.Core.Tests/Castle.Core.Tests.csproj index 24bd42eda0..84501d5e4f 100644 --- a/src/Castle.Core.Tests/Castle.Core.Tests.csproj +++ b/src/Castle.Core.Tests/Castle.Core.Tests.csproj @@ -51,15 +51,18 @@ + + + diff --git a/src/Castle.Core.Tests/PublicApiTestCase.cs b/src/Castle.Core.Tests/PublicApiTestCase.cs index ef8d15808b..94830a5f21 100644 --- a/src/Castle.Core.Tests/PublicApiTestCase.cs +++ b/src/Castle.Core.Tests/PublicApiTestCase.cs @@ -40,6 +40,7 @@ public class PublicApiTestCase "Castle.Services.Logging.log4netIntegration", "Castle.Services.Logging.NLogIntegration", "Castle.Services.Logging.SerilogIntegration", + "Castle.Services.Logging.DiagnosticsLogger", }; [Test] diff --git a/src/Castle.Core.Tests/Core.Tests/Logging/DiagnosticsLoggerTestCase.cs b/src/Castle.Core.Tests/Services.Logging.Tests/DiagnosticLogger/DiagnosticsLoggerTestCase.cs similarity index 100% rename from src/Castle.Core.Tests/Core.Tests/Logging/DiagnosticsLoggerTestCase.cs rename to src/Castle.Core.Tests/Services.Logging.Tests/DiagnosticLogger/DiagnosticsLoggerTestCase.cs diff --git a/src/Castle.Core/Castle.Core.csproj b/src/Castle.Core/Castle.Core.csproj index 679bf7e168..ce727102f5 100644 --- a/src/Castle.Core/Castle.Core.csproj +++ b/src/Castle.Core/Castle.Core.csproj @@ -36,14 +36,6 @@ - - - - - - - - diff --git a/src/Castle.Services.Logging.DiagnosticsLogger/Castle.Services.Logging.DiagnosticsLogger.csproj b/src/Castle.Services.Logging.DiagnosticsLogger/Castle.Services.Logging.DiagnosticsLogger.csproj new file mode 100644 index 0000000000..1644276682 --- /dev/null +++ b/src/Castle.Services.Logging.DiagnosticsLogger/Castle.Services.Logging.DiagnosticsLogger.csproj @@ -0,0 +1,39 @@ + + + + + + net462;netstandard2.0;netstandard2.1;net6.0 + + + + Castle.Core-DiagnosticsLogger + True + ../../build/ + Castle.Services.Logging.DiagnosticsLogger + Castle.Services.Logging.DiagnosticsLogger + Castle.Services.Logging.DiagnosticsLogger + Castle Services DiagnosticsLogger for Windows EventLog + ..\..\buildscripts\CastleKey.snk + True + true + castle logging eventlog + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Castle.Core/Core/Logging/DiagnosticsLogger.cs b/src/Castle.Services.Logging.DiagnosticsLogger/DiagnosticsLogger.cs similarity index 98% rename from src/Castle.Core/Core/Logging/DiagnosticsLogger.cs rename to src/Castle.Services.Logging.DiagnosticsLogger/DiagnosticsLogger.cs index bf591efc33..c9f77f10b3 100644 --- a/src/Castle.Core/Core/Logging/DiagnosticsLogger.cs +++ b/src/Castle.Services.Logging.DiagnosticsLogger/DiagnosticsLogger.cs @@ -1,4 +1,4 @@ -// Copyright 2004-2022 Castle Project - http://www.castleproject.org/ +// Copyright 2004-2022 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Castle.Core/Core/Logging/DiagnosticsLoggerFactory.cs b/src/Castle.Services.Logging.DiagnosticsLogger/DiagnosticsLoggerFactory.cs similarity index 94% rename from src/Castle.Core/Core/Logging/DiagnosticsLoggerFactory.cs rename to src/Castle.Services.Logging.DiagnosticsLogger/DiagnosticsLoggerFactory.cs index 97ee575e03..2d8c32edd1 100644 --- a/src/Castle.Core/Core/Logging/DiagnosticsLoggerFactory.cs +++ b/src/Castle.Services.Logging.DiagnosticsLogger/DiagnosticsLoggerFactory.cs @@ -1,4 +1,4 @@ -// Copyright 2004-2022 Castle Project - http://www.castleproject.org/ +// Copyright 2004-2022 Castle Project - http://www.castleproject.org/ // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.