Serilog.Sinks.EventLog 4.0.0-dev-00077

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

Showing the top 20 packages that depend on Serilog.Sinks.EventLog.

Packages Downloads
Serilog.Exceptions
Log exception details and custom properties that are not output in Exception.ToString().
60

.NET Framework 4.6.2

.NET Framework 4.7.1

.NET 6.0

.NET 8.0

.NET Standard 2.0

Version Downloads Last updated
5.0.0-dev-00091 49 01/31/2025
4.0.1-dev-00087 46 12/19/2024
4.0.0 46 12/29/2024
4.0.0-dev-00079 48 12/24/2024
4.0.0-dev-00077 45 12/24/2024
3.1.0 41 05/29/2024
3.1.0-dev-00060 47 05/29/2024
3.1.0-dev-00056 49 05/29/2024
3.1.0-dev-00049 47 05/29/2024
3.0.47 48 05/29/2024
3.0.37-dev-00048 49 05/29/2024
3.0.37-dev-00043 50 05/29/2024
3.0.37-dev-00040 42 05/29/2024
3.0.37-dev-00038 51 05/29/2024
3.0.36 46 05/29/2024
2.1.30 42 05/29/2024
2.0.22 48 05/29/2024
2.0.21 53 05/29/2024
2.0.13 47 05/29/2024
1.5.11 48 05/29/2024
1.5.8 43 05/29/2024
1.5.4 47 05/29/2024
1.5.3 48 05/29/2024
1.5.2 49 05/29/2024
1.5.1 51 05/29/2024
1.4.196 49 05/29/2024
1.4.182 52 05/29/2024
1.4.168 51 05/29/2024
1.4.155 49 05/29/2024
1.4.139 36 05/29/2024
1.4.118 41 05/29/2024
1.4.113 46 05/29/2024
1.4.102 45 05/29/2024
1.4.99 48 05/29/2024
1.4.97 46 05/29/2024
1.4.76 49 05/29/2024
1.4.39 46 05/29/2024
1.4.34 45 05/29/2024
1.4.28 45 05/29/2024
1.4.27 46 05/29/2024
1.4.23 50 05/29/2024
1.4.22 47 05/29/2024
1.4.21 40 05/29/2024
1.4.18 45 05/29/2024