System.Diagnostics.EventSourceCreationData.LogName Property

Gets or sets the name of the event log to which the source writes entries.

Syntax

public string LogName { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the EventSourceCreationData.LogName property to identify the event log that your application writes entries to using the new source. The event log can be a new log or an existing log. Applications and services should write to the Application log or a custom log. Device drivers should write to the System log. If you do not explicitly set the EventSourceCreationData.LogName property, the event log defaults to the Application log.

Note:

The Security log is read-only.

To target an existing log for the new source, set the EventSourceCreationData.LogName property to the existing event log name. To create a new event log for the source, you must set the EventSourceCreationData.LogName property. Event log names must consist of printable characters, and cannot include the characters '*', '?', or '\'. The first 8 characters of the event log name must be different from the first 8 characters of existing names of event logs on the specified computer.

The operating system stores event logs as files. When you use System.Diagnostics.EventLogInstaller or the erload:System.Diagnostics.EventLog.CreateEventSource method to create a new event log, the associated file is stored in the %SystemRoot%\System32\Config directory on the specified computer. The file name is set by appending the first 8 characters of the EventSourceCreationData.LogName property with the ".evt" file name extension.

Requirements

Namespace: System.Diagnostics
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0