System.Diagnostics.EventSourceCreationData.Source Property

Gets or sets the name to register with the event log as an event source.

Syntax

public string Source { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

The source name is often the name of the application, or the name of a component within a large application. The EventLog.CreateEventSource(EventSourceCreationData) method uses the EventSourceCreationData.Source, EventSourceCreationData.LogName, and EventSourceCreationData.MachineName properties to create registry values on the target computer for the new source and its associated event log. A new source name cannot match an existing source name or an existing event log name on the target computer.

After the registry values for the source are created, your application can use the source to write entries to the configured event log.

Each source can only write to one event log at a time; however, your application can use multiple sources to write to multiple event logs. For example, your application might require multiple sources configured for different event logs or different resource files.

Requirements

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