<PackageReference Include="System.Diagnostics.EventLog" Version="10.0.2" />

System.Diagnostics.Eventing.Reader.EventLogSession

public class EventLogSession : IDisposable
Used to access the Event Log service on the local computer or a remote computer so you can manage and gather information about the event logs and event providers on the computer.
namespace System.Diagnostics.Eventing.Reader { public class EventLogSession : IDisposable { public static EventLogSession GlobalSession { get; } public EventLogSession(); public EventLogSession(string server); public EventLogSession(string server, string domain, string user, SecureString password, SessionAuthentication logOnType); public void CancelCurrentOperations(); public void ClearLog(string logName); public void ClearLog(string logName, string backupPath); public void Dispose(); protected virtual void Dispose(bool disposing); public void ExportLog(string path, PathType pathType, string query, string targetFilePath); public void ExportLog(string path, PathType pathType, string query, string targetFilePath, bool tolerateQueryErrors); public void ExportLogAndMessages(string path, PathType pathType, string query, string targetFilePath); public void ExportLogAndMessages(string path, PathType pathType, string query, string targetFilePath, bool tolerateQueryErrors, CultureInfo targetCultureInfo); public EventLogInformation GetLogInformation(string logName, PathType pathType); public IEnumerable<string> GetLogNames(); public IEnumerable<string> GetProviderNames(); } }