<PackageReference Include="NLog" Version="6.1.4" />

NLog.Targets.EventLogTarget

Writes log message to the Event Log.
public Layout<short> Category { get; set; }

Gets or sets the layout that renders event Category.

public Layout<EventLogEntryType> EntryType { get; set; }

Optional entry type. When not set, or when not convertible to EventLogEntryType then determined by LogLevel

public Layout<int> EventId { get; set; }

Gets or sets the layout that renders event ID.

public Layout Log { get; set; }

Gets or sets the name of the Event Log to write to. This can be System, Application or any user-defined name.

public Layout MachineName { get; set; }

Gets or sets the name of the machine on which Event Log service is running.

public Layout<long> MaxKilobytes { get; set; }

Gets or sets the maximum Event log size in kilobytes.

public Layout<int> MaxMessageLength { get; set; }

Gets or sets the message length limit to write to the Event Log.

Gets or sets the action to take if the message is larger than the MaxMessageLength option.

public Layout Source { get; set; }

Gets or sets the value to be used as the event Source.

public EventLogTarget()

Initializes a new instance of the EventLogTarget class.

public EventLogTarget(string name)

Initializes a new instance of the EventLogTarget class.

public void Install(InstallationContext installationContext)

Performs installation which requires administrative permissions.

public bool? IsInstalled(InstallationContext installationContext)

Determines whether the item is installed.

public void Uninstall(InstallationContext installationContext)

Performs uninstallation which requires administrative permissions.