System.Diagnostics.EventLog 10.0.11

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package System.Diagnostics.EventLog --version 10.0.11
                    
NuGet\Install-Package System.Diagnostics.EventLog -Version 10.0.11
                    
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="System.Diagnostics.EventLog" Version="10.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="System.Diagnostics.EventLog" Version="10.0.11" />
                    
Directory.Packages.props
<PackageReference Include="System.Diagnostics.EventLog" />
                    
Project file
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 System.Diagnostics.EventLog --version 10.0.11
                    
#r "nuget: System.Diagnostics.EventLog, 10.0.11"
                    
#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 System.Diagnostics.EventLog@10.0.11
                    
#: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=System.Diagnostics.EventLog&version=10.0.11
                    
Install as a Cake Addin
#tool nuget:?package=System.Diagnostics.EventLog&version=10.0.11
                    
Install as a Cake Tool

About

This package provides types that allow applications to interact with the Windows Event Log service.

When an error occurs in a Windows machine, the system administrator or support representative must determine what caused the error, attempt to recover any lost data, and prevent the error from recurring. It is helpful if applications, the operating system, and other system services record important events, such as low-memory conditions or excessive attempts to access a disk. The system administrator can then use the Windows Event Log to help determine what conditions caused the error and identify the context in which it occurred.

Key Features

  • Allows reading from existing logs.
  • Allows writing entries to logs.
  • Can create or delete event sources.
  • Can delete logs.
  • Can respond to log entries.
  • Can create new logs when creating an event source.

How to Use

if(!EventLog.SourceExists("MySource"))
{
    // An event log source should not be created and immediately used.
    // There is a latency time to enable the source, it should be created
    // prior to executing the application that uses the source.
    // Execute this sample a second time to use the new source.
    EventLog.CreateEventSource("MySource", "MyNewLog");
    Console.WriteLine("Event source created. Exiting, execute the application a second time to use the source.");
    // The source is created. Exit the application to allow it to be registered.
    return;
}

EventLog myLog = new();
myLog.Source = "MySource";
myLog.WriteEntry("Writing an informational entry to the event log.");

Notes:

  • This assembly is only supported on Windows operating systems.
  • Starting with Windows Vista, you must run the application as an administrator to interact with the Windows Event Log service using the System.Diagnostics.EventLog class.

Main Types

The main types provided by this library are:

Under the System.Diagnostics namespace, the main types are:

Under the System.Diagnostics.Eventing.Reader namespace, the main types are:

Additional Documentation

Feedback & Contributing

System.Diagnostics.EventLog is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (323)

Showing the top 5 NuGet packages that depend on System.Diagnostics.EventLog:

Package Downloads
System.Configuration.ConfigurationManager

Provides types that support using XML configuration files (app.config). This package exists only to support migrating existing .NET Framework code that already uses System.Configuration. When writing new code, use another configuration system instead, such as Microsoft.Extensions.Configuration.

Castle.Core

Castle Core, including DynamicProxy, Logging Abstractions and DictionaryAdapter

Microsoft.Extensions.Logging.EventLog

Windows Event Log logger provider implementation for Microsoft.Extensions.Logging.

Microsoft.Build

This package contains the Microsoft.Build assembly which is used to create, edit, and evaluate MSBuild projects.

System.ServiceProcess.ServiceController

Provides the System.ServiceProcess.ServiceController class, which allows you to connect to a Windows service, manipulate it, or get information about it. Commonly Used Types: System.ServiceProcess.ServiceController System.ServiceProcess.ServiceControllerStatus System.ServiceProcess.ServiceType

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.0-preview.7.26381.103 18,466 8/11/2026
11.0.0-preview.6.26359.118 32,566 7/14/2026
11.0.0-preview.5.26302.115 70,045 6/9/2026
11.0.0-preview.4.26230.115 34,659 5/12/2026
11.0.0-preview.3.26207.106 28,529 4/14/2026
11.0.0-preview.2.26159.112 35,961 3/10/2026
10.0.11 2,728,098 8/11/2026
10.0.10 8,746,155 7/14/2026
10.0.9 14,154,361 6/9/2026
10.0.8 15,297,009 5/12/2026
10.0.7 14,849,639 4/21/2026
10.0.6 4,041,283 4/14/2026
10.0.5 16,839,647 3/12/2026
10.0.4 1,970,911 3/10/2026
9.0.19 100,458 8/11/2026
9.0.18 413,701 7/14/2026
9.0.17 538,091 6/9/2026
9.0.16 576,423 5/12/2026
9.0.15 1,463,469 4/14/2026
9.0.14 1,491,893 3/10/2026
Loading failed