fm.Extensions.Logging.EventLog
9.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package fm.Extensions.Logging.EventLog --version 9.0.0
NuGet\Install-Package fm.Extensions.Logging.EventLog -Version 9.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="fm.Extensions.Logging.EventLog" Version="9.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="fm.Extensions.Logging.EventLog" Version="9.0.0" />
<PackageReference Include="fm.Extensions.Logging.EventLog" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add fm.Extensions.Logging.EventLog --version 9.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: fm.Extensions.Logging.EventLog, 9.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package fm.Extensions.Logging.EventLog@9.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=fm.Extensions.Logging.EventLog&version=9.0.0
#tool nuget:?package=fm.Extensions.Logging.EventLog&version=9.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
About
Simplifies the use of Microsoft.Extensions.Logging.EventLog.
How to Use
[TestClass]
public sealed class ExampleTests : ServiceTestsBase // Provided by fm.Extensions.Testing.DependencyInjection
{
protected override void ConfigureLogging(ILoggingBuilder builder)
{
base.ConfigureLogging(builder);
switch (this.TestName)
{
case nameof(this.CreateTest):
// Needs administrator permissions for creation.
builder.TryAddEventLogAndCreateSource(sourceName: "DCOM");
break;
case nameof(this.UseTest):
builder.TryAddEventLogAndUseSource(sourceName: "DCOM");
break;
}
}
[TestMethod]
public void CreateTest()
{
this.GetRequiredService<IOptions<EventLogSettings>>().Value.Should(s =>
{
s.LogName.ShouldBe("System"); // Autpmatically determined.
s.SourceName.ShouldBe("DCOM");
});
}
[TestMethod]
public void UseTest()
{
this.GetRequiredService<IOptions<EventLogSettings>>().Value.Should(s =>
{
s.LogName.ShouldBe("System"); // Autpmatically determined.
s.SourceName.ShouldBe("DCOM");
});
}
}
Main Types
The main types provided by this library are:
EventLogLoggingBuilderExtensions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Logging (>= 9.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Logging.EventLog (>= 9.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0 | 268 | 11/13/2025 |
| 9.0.0 | 190 | 10/13/2025 |
| 8.0.0 | 286 | 11/15/2024 |
| 7.0.0 | 341 | 3/27/2024 |
| 6.1.0 | 328 | 11/10/2023 |
| 6.0.0 | 526 | 3/4/2023 |
| 5.2.1 | 662 | 12/30/2021 |
| 5.2.0 | 534 | 11/11/2021 |
| 5.1.0 | 563 | 8/11/2021 |
| 5.0.0 | 727 | 11/17/2020 |
| 4.3.0 | 785 | 3/18/2020 |
| 4.2.0 | 766 | 1/4/2020 |
| 4.1.0 | 726 | 11/22/2019 |
| 3.0.0 | 1,594 | 10/9/2017 |
| 2.0.0 | 1,774 | 6/29/2016 |
BREAKING: Redesign EventLogLoggingBuilderExtensions to prevent misuse.