<PackageReference Include="System.Diagnostics.EventLog" Version="11.0.0-preview.2.26159.112" />

System.Diagnostics.EventLog

Provides interaction with Windows event logs.
namespace System.Diagnostics { public class EventLog : Component, ISupportInitialize { public bool EnableRaisingEvents { get; set; } public EventLogEntryCollection Entries { get; } public string Log { get; set; } public string LogDisplayName { get; } public string MachineName { get; set; } public long MaximumKilobytes { get; set; } public int MinimumRetentionDays { get; } public OverflowAction OverflowAction { get; } public string Source { get; set; } public ISynchronizeInvoke SynchronizingObject { get; set; } public event EntryWrittenEventHandler EntryWritten; public EventLog(); public EventLog(string logName); public EventLog(string logName, string machineName); public EventLog(string logName, string machineName, string source); public void BeginInit(); public void Clear(); public void Close(); public static void CreateEventSource(EventSourceCreationData sourceData); public static void CreateEventSource(string source, string logName); public static void CreateEventSource(string source, string logName, string machineName); public static void Delete(string logName); public static void Delete(string logName, string machineName); public static void DeleteEventSource(string source); public static void DeleteEventSource(string source, string machineName); public void EndInit(); public static bool Exists(string logName); public static bool Exists(string logName, string machineName); public static EventLog[] GetEventLogs(); public static EventLog[] GetEventLogs(string machineName); public static string LogNameFromSourceName(string source, string machineName); public void ModifyOverflowPolicy(OverflowAction action, int retentionDays); public void RegisterDisplayName(string resourceFile, long resourceId); public static bool SourceExists(string source); public static bool SourceExists(string source, string machineName); public void WriteEntry(string message); public void WriteEntry(string message, EventLogEntryType type); public void WriteEntry(string message, EventLogEntryType type, int eventID); public void WriteEntry(string message, EventLogEntryType type, int eventID, short category); public void WriteEntry(string message, EventLogEntryType type, int eventID, short category, byte[] rawData); public static void WriteEntry(string source, string message); public static void WriteEntry(string source, string message, EventLogEntryType type); public static void WriteEntry(string source, string message, EventLogEntryType type, int eventID); public static void WriteEntry(string source, string message, EventLogEntryType type, int eventID, short category); public static void WriteEntry(string source, string message, EventLogEntryType type, int eventID, short category, byte[] rawData); public void WriteEvent(EventInstance instance, byte[] data, params object[] values); public void WriteEvent(EventInstance instance, params object[] values); public static void WriteEvent(string source, EventInstance instance, byte[] data, params object[] values); public static void WriteEvent(string source, EventInstance instance, params object[] values); } }