Skip to content

net472_EventLogHelper.Interfaces_IEventLogWriter_GetLog

dparvin edited this page Sep 10, 2025 · 1 revision

IEventLogWriter.GetLog method

Retrieves or initializes an EventLog instance with the specified configuration.

public EventLog GetLog(string machineName, string logName, string sourceName, int maxKilobytes, 
    int retentionDays, bool writeInitEntry)
parameter description
machineName The name of the machine (use "." for the local machine).
logName The name of the log (e.g., "Application" or a custom log).
sourceName The name of the event source to use or create.
maxKilobytes Maximum size of the log in kilobytes.
retentionDays Number of days to retain log entries before overwriting.
writeInitEntry If True, an initialization entry is written upon setup.

Return Value

An EventLog instance configured with the specified parameters.

See Also

Clone this wiki locally