Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Castle.Services.Logging.EventLogIntegration for Windows EventLog #694

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# Several .NET Core versions will be used during the test run.
# The lowest version gets installed first in order to prevent
# "a newer version is already installed" install errors.

- name: Install .NET Core 2.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 2.1.x

- name: Install .NET Core 3.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.x

- name: Install .NET 6.0
uses: actions/setup-dotnet@v4
with:
Expand All @@ -68,12 +54,6 @@ jobs:
# Test
# ----

- name: Test on .NET Core 2.1
run: dotnet test -c Release -f netcoreapp2.1 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Core 3.1
run: dotnet test -c Release -f netcoreapp3.1 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET 6.0
run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"

Expand Down
11 changes: 9 additions & 2 deletions Castle.Core.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.EventLogIntegration", "src\Castle.Services.Logging.EventLogIntegration\Castle.Services.Logging.EventLogIntegration.csproj", "{93E71739-D2F2-4CE4-8F9F-0C564CBE6B21}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -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
{93E71739-D2F2-4CE4-8F9F-0C564CBE6B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{93E71739-D2F2-4CE4-8F9F-0C564CBE6B21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{93E71739-D2F2-4CE4-8F9F-0C564CBE6B21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{93E71739-D2F2-4CE4-8F9F-0C564CBE6B21}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -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}
{93E71739-D2F2-4CE4-8F9F-0C564CBE6B21} = {A598EE9B-41CE-4BE8-BF93-2C91F919F97E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {682D4399-4863-4813-B495-5FEDD22496ED}
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ for:
after_build:
- ps: |
$wc = New-Object System.Net.WebClient
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrWeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60TestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60WeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrTestResults.xml"))
Expand All @@ -70,6 +68,7 @@ for:
nuget push ".\build\Castle.Core-log4net.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json
nuget push ".\build\Castle.Core-NLog.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json
nuget push ".\build\Castle.Core-Serilog.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json
nuget push ".\build\Castle.Core-DiagnosticsLogger.${env:APPVEYOR_BUILD_VERSION}.nupkg" -ApiKey $env:NUGET_API_KEY -Source https://api.nuget.org/v3/index.json
}

# upload packages to AppVeyor
Expand Down
17 changes: 1 addition & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ echo --------------------
mono ./src/Castle.Core.Tests/bin/Release/net462/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3
mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net462/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3

echo ---------------------------
echo Running NETCOREAPP3.1 Tests
echo ---------------------------

dotnet ./src/Castle.Core.Tests/bin/Release/netcoreapp3.1/Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3

echo ---------------------------
echo Running NET6.0 Tests
echo ---------------------------
Expand All @@ -62,9 +55,7 @@ dotnet ./src/Castle.Core.Tests/bin/Release/net6.0/Castle.Core.Tests.dll --result
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3

# Ensure that all test runs produced a protocol file:
if [[ !( -f NetCoreClrTestResults.xml &&
-f NetCoreClrWeakNamedTestResults.xml &&
-f Net60TestResults.xml &&
if [[ !( -f Net60TestResults.xml &&
-f Net60WeakNamedTestResults.xml &&
-f DesktopClrTestResults.xml &&
-f DesktopClrWeakNamedTestResults.xml ) ]]; then
Expand All @@ -73,12 +64,6 @@ if [[ !( -f NetCoreClrTestResults.xml &&
fi

# Unit test failure
NETCORE_FAILCOUNT=$(grep -F "One or more child tests had errors" NetCoreClrTestResults.xml NetCoreClrWeakNamedTestResults.xml | wc -l)
if [ $NETCORE_FAILCOUNT -ne 0 ]
then
echo "NetCore Tests have failed, failing the build"
exit 1
fi

NET60_FAILCOUNT=$(grep -F "One or more child tests had errors" Net60TestResults.xml Net60WeakNamedTestResults.xml | wc -l)
if [ $NET60_FAILCOUNT -ne 0 ]
Expand Down
8 changes: 0 additions & 8 deletions buildscripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ echo --------------------
%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests/bin/%Configuration%/net462/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3 || exit /b 1
%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests.WeakNamed/bin/%Configuration%/net462/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1

echo ---------------------------
echo Running NETCOREAPP3.1 Tests
echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\netcoreapp3.1\Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1


echo ---------------------------
echo Running NET6.0 Tests
echo ---------------------------
Expand Down
19 changes: 0 additions & 19 deletions ref/Castle.Core-net462.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1993,25 +1993,6 @@ public ConsoleLogger(string name, Castle.Core.Logging.LoggerLevel logLevel) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
[System.Serializable]
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
[System.Serializable]
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
public interface IContextProperties
{
object this[string key] { get; set; }
Expand Down
19 changes: 0 additions & 19 deletions ref/Castle.Core-net6.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1984,25 +1984,6 @@ public ConsoleLogger(string name, Castle.Core.Logging.LoggerLevel logLevel) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
public interface IContextProperties
{
object this[string key] { get; set; }
Expand Down
17 changes: 0 additions & 17 deletions ref/Castle.Core-netstandard2.0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1984,23 +1984,6 @@ public ConsoleLogger(string name, Castle.Core.Logging.LoggerLevel logLevel) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
public interface IContextProperties
{
object this[string key] { get; set; }
Expand Down
17 changes: 0 additions & 17 deletions ref/Castle.Core-netstandard2.1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1984,23 +1984,6 @@ public ConsoleLogger(string name, Castle.Core.Logging.LoggerLevel logLevel) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
public interface IContextProperties
{
object this[string key] { get; set; }
Expand Down
24 changes: 24 additions & 0 deletions ref/Castle.Services.Logging.EventlogIntegration-net462.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Castle.Core.Logging
{
[System.Serializable]
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
[System.Serializable]
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
}
24 changes: 24 additions & 0 deletions ref/Castle.Services.Logging.EventlogIntegration-net6.0.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName=".NET 6.0")]
namespace Castle.Core.Logging
{
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
}
22 changes: 22 additions & 0 deletions ref/Castle.Services.Logging.EventlogIntegration-netstandard2.0.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName=".NET Standard 2.0")]
namespace Castle.Core.Logging
{
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
}
22 changes: 22 additions & 0 deletions ref/Castle.Services.Logging.EventlogIntegration-netstandard2.1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName=".NET Standard 2.1")]
namespace Castle.Core.Logging
{
public class DiagnosticsLogger : Castle.Core.Logging.LevelFilteredLogger, System.IDisposable
{
public DiagnosticsLogger(string logName) { }
public DiagnosticsLogger(string logName, string source) { }
public DiagnosticsLogger(string logName, string machineName, string source) { }
public override Castle.Core.Logging.ILogger CreateChildLogger(string loggerName) { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected override void Finalize() { }
protected override void Log(Castle.Core.Logging.LoggerLevel loggerLevel, string loggerName, string message, System.Exception exception) { }
}
public class DiagnosticsLoggerFactory : Castle.Core.Logging.AbstractLoggerFactory
{
public DiagnosticsLoggerFactory() { }
public override Castle.Core.Logging.ILogger Create(string name) { }
public override Castle.Core.Logging.ILogger Create(string name, Castle.Core.Logging.LoggerLevel level) { }
}
}
Loading
Loading