Skip to main content
.NETFramework4.6.2.NETFramework4.7.1net6.0net8.0.NETStandard2.0

Serilog event sink that writes to the Windows Event Log.

Published
Jun 9, 2024
2y ago
Total Downloads
63.7M
63,673,662

Install

dotnet add package Serilog.Sinks.EventLog --version 4.0.0-dev-00077
ProductVersions
.NET
net6.0net8.0
.NET Standard
netstandard2.0
Other
.NETFramework4.6.2.NETFramework4.7.1

README

Serilog.Sinks.EventLog

Build status NuGet Version

A Serilog sink that writes events to the Windows Event Log.

Important: version 3.0 of this sink changed the default value of manageEventSource from true to false. Applications that run with administrative privileges, and that can therefore create event sources on-the-fly, can opt in by providing manageEventSource: true as a configuration option.

Getting started

First, install the package from NuGet:

dotnet add package Serilog.Sinks.EventLog

The sink is configured by calling WriteTo.EventLog() on the LoggerConfiguration:

Log.Logger = new LoggerConfiguration()
    .WriteTo.EventLog("Sample App", manageEventSource: true)
    .CreateLogger();

Log.Information("Hello, Windows Event Log!");

Log.CloseAndFlush();

Events will appear under the Application log with the specified source name:

Screenshot

Changes from Previous Version

v3.1.0v4.0.0-dev-00077
Added Frameworks
.NETFramework4.6.2.NETFramework4.7.1net6.0net8.0
Removed Frameworks
.NETFramework4.5
Added Dependencies
Serilog(.NETFramework4.6.2)
Serilog(.NETFramework4.7.1)
Serilog(net6.0)
Serilog(net8.0)
Removed Dependencies
Serilog(.NETFramework4.5)

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.